diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2017-05-17 15:27:04 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-05-17 15:27:04 +0200 |
commit | 61a0eba14ff311dff49457ed3cef955a97abc905 (patch) | |
tree | 7635ce2f48e76ab1c64f8900344cd05efb2727a1 /tests/stdlib/tmarshal.nim | |
parent | 503f7806765f0cc6f072f578e272d12d3f9cce56 (diff) | |
parent | 672c24e4b8fcfc07cdba6a36a2fc0445cdc3d9e9 (diff) | |
download | Nim-61a0eba14ff311dff49457ed3cef955a97abc905.tar.gz |
Merge branch 'zahary' into araq2
Diffstat (limited to 'tests/stdlib/tmarshal.nim')
-rw-r--r-- | tests/stdlib/tmarshal.nim | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/stdlib/tmarshal.nim b/tests/stdlib/tmarshal.nim index b05cb5a10..6a53a2964 100644 --- a/tests/stdlib/tmarshal.nim +++ b/tests/stdlib/tmarshal.nim @@ -1,7 +1,10 @@ discard """ output: '''{"age": 12, "bio": "\u042F Cletus", "blob": [65, 66, 67, 128], "name": "Cletus"} true -true''' +true +alpha 100 +omega 200 +''' """ import marshal @@ -83,3 +86,22 @@ var instance1 = Person(name: "Cletus", age: 12, echo($$instance1) echo(to[Person]($$instance1).bio == instance1.bio) echo(to[Person]($$instance1).blob == instance1.blob) + +# bug 5757 + +type + Something = object + x: string + y: int + +var data1 = """{"x": "alpha", "y": 100}""" +var data2 = """{"x": "omega", "y": 200}""" + +var r = to[Something](data1) + +echo r.x, " ", r.y + +r = to[Something](data2) + +echo r.x, " ", r.y + |