summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorJason Beetham <beefers331@gmail.com>2021-01-25 16:55:49 -0700
committerGitHub <noreply@github.com>2021-01-26 00:55:49 +0100
commitdde096ffdea2c551a9b00af533b13106528ac4a1 (patch)
tree62929e94b6b0fe70c54ff02e5d083508e644630e /tests
parent25745ad195580772d4689a7c98f9b3f77f06cdd1 (diff)
downloadNim-dde096ffdea2c551a9b00af533b13106528ac4a1.tar.gz
added enum indexed array support to json (#16807)
* added enum indexed array support to json

* Added json test

* Removed when statement for enum indexed arrays
Diffstat (limited to 'tests')
-rw-r--r--tests/stdlib/tjson_enum_index.nim11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/stdlib/tjson_enum_index.nim b/tests/stdlib/tjson_enum_index.nim
new file mode 100644
index 000000000..2c24f4f36
--- /dev/null
+++ b/tests/stdlib/tjson_enum_index.nim
@@ -0,0 +1,11 @@
+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