mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-29 10:43:57 +00:00
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
This commit is contained in:
11
tests/stdlib/tjson_enum_index.nim
Normal file
11
tests/stdlib/tjson_enum_index.nim
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user