From ecc9704bf406c65dce549b0c5542727d33816e7f Mon Sep 17 00:00:00 2001 From: Jason Beetham Date: Mon, 25 Jan 2021 19:35:08 -0700 Subject: [PATCH] Moved json enum index test to the proper file (#16826) --- tests/stdlib/tjson_enum_index.nim | 11 ----------- tests/stdlib/tjsonmacro.nim | 12 ++++++++++++ 2 files changed, 12 insertions(+), 11 deletions(-) delete mode 100644 tests/stdlib/tjson_enum_index.nim diff --git a/tests/stdlib/tjson_enum_index.nim b/tests/stdlib/tjson_enum_index.nim deleted file mode 100644 index 2c24f4f36b..0000000000 --- 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 938030d8ee..779c0ce651 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()