Moved json enum index test to the proper file (#16826)

This commit is contained in:
Jason Beetham
2021-01-25 19:35:08 -07:00
committed by GitHub
parent dde096ffde
commit ecc9704bf4
2 changed files with 12 additions and 11 deletions

View File

@@ -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

View File

@@ -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()