mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-15 23:54:19 +00:00
Moved json enum index test to the proper file (#16826)
This commit is contained in:
@@ -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
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user