diff options
author | rumpf_a@web.de <> | 2010-02-21 19:42:36 +0100 |
---|---|---|
committer | rumpf_a@web.de <> | 2010-02-21 19:42:36 +0100 |
commit | d913fdb2800d83680e413cd8a5f07b7f85deac6e (patch) | |
tree | 09a284861adf96520059f211ba8bae1a76294a9c /tests/accept/compile/trepr.nim | |
parent | 6bc16904edd3738ab97573b9eeb3a6a7cce9574c (diff) | |
download | Nim-d913fdb2800d83680e413cd8a5f07b7f85deac6e.tar.gz |
start of tests refactoring; sqlite3 new wrapper fixes
Diffstat (limited to 'tests/accept/compile/trepr.nim')
-rw-r--r-- | tests/accept/compile/trepr.nim | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/accept/compile/trepr.nim b/tests/accept/compile/trepr.nim new file mode 100644 index 000000000..4a56842f6 --- /dev/null +++ b/tests/accept/compile/trepr.nim @@ -0,0 +1,32 @@ +# test the new "repr" built-in proc + +type + TEnum = enum + en1, en2, en3, en4, en5, en6 + + TPoint {.final.} = object + x, y, z: int + s: array [0..1, string] + e: TEnum + +var + p: TPoint + q: ref TPoint + s: seq[ref TPoint] + +p.x = 0 +p.y = 13 +p.z = 45 +p.s[0] = "abc" +p.s[1] = "xyz" +p.e = en6 + +new(q) +q^ = p + +s = @[q, q, q, q] + +writeln(stdout, repr(p)) +writeln(stdout, repr(q)) +writeln(stdout, repr(s)) +writeln(stdout, repr(en4)) |