diff options
author | Araq <rumpf_a@web.de> | 2014-12-14 11:49:32 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-12-14 11:49:32 +0100 |
commit | bebac34f878a87419c5d0e24a18edb50ebad5f0a (patch) | |
tree | e871d2e512857bd7be494aa367aca26176cd4c2c /tests/stdlib | |
parent | 556f4880874b09bccea99bbb3b7aa46159977fef (diff) | |
download | Nim-bebac34f878a87419c5d0e24a18edb50ebad5f0a.tar.gz |
fixes #1352
Diffstat (limited to 'tests/stdlib')
-rw-r--r-- | tests/stdlib/tmarshal.nim | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/stdlib/tmarshal.nim b/tests/stdlib/tmarshal.nim index 5471d347a..1b83aab53 100644 --- a/tests/stdlib/tmarshal.nim +++ b/tests/stdlib/tmarshal.nim @@ -1,10 +1,10 @@ discard """ - output: "" + output: '''{"age": 12, "name": "Cletus"}''' """ import marshal -template testit(x: expr) = echo($$to[type(x)]($$x)) +template testit(x: expr) = discard $$to[type(x)]($$x) var x: array[0..4, array[0..4, string]] = [ ["test", "1", "2", "3", "4"], ["test", "1", "2", "3", "4"], @@ -63,3 +63,15 @@ testit(test7) var test6: set[char] = {'A'..'Z', '_'} testit(test6) + +# bug #1352 + +type + Entity = object of RootObj + name: string + + Person = object of Entity + age: int + +var instance1 = Person(name: "Cletus", age: 12) +echo($$instance1) |