diff options
-rw-r--r-- | tests/stdlib/tjson_enum_index.nim | 11 | ||||
-rw-r--r-- | tests/stdlib/tjsonmacro.nim | 12 |
2 files changed, 12 insertions, 11 deletions
diff --git a/tests/stdlib/tjson_enum_index.nim b/tests/stdlib/tjson_enum_index.nim deleted file mode 100644 index 2c24f4f36..000000000 --- a/tests/stdlib/tjson_enum_index.nim +++ /dev/null @@ -1,11 +0,0 @@ -import json -type Test = enum - one, two, three, four, five -let a = [ - one: 300, - two: 20, - three: 10, - four: 0, - five: -10 -] -doAssert (%* a).to(a.typeof) == a \ No newline at end of file diff --git a/tests/stdlib/tjsonmacro.nim b/tests/stdlib/tjsonmacro.nim index 938030d8e..779c0ce65 100644 --- a/tests/stdlib/tjsonmacro.nim +++ b/tests/stdlib/tjsonmacro.nim @@ -633,6 +633,18 @@ proc testJson() = except KeyError: doAssert getCurrentExceptionMsg().contains ".member.list[2].value" + block: + # Enum indexed array test + type Test = enum + one, two, three, four, five + let a = [ + one: 300, + two: 20, + three: 10, + four: 0, + five: -10 + ] + doAssert (%* a).to(a.typeof) == a testJson() |