mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 14:00:35 +00:00
Add test for previous commit.
This commit is contained in:
@@ -217,4 +217,13 @@ when isMainModule:
|
||||
}
|
||||
""")
|
||||
data = to(jsonNode, Data)
|
||||
doAssert data.person.isNil
|
||||
doAssert data.person.isNil
|
||||
|
||||
block:
|
||||
type
|
||||
FooBar = object
|
||||
field: float
|
||||
|
||||
let x = parseJson("""{ "field": 5}""")
|
||||
let data = to(x, FooBar)
|
||||
doAssert data.field == 5.0
|
||||
Reference in New Issue
Block a user