follow up #19968; add more tests (#20396)

This commit is contained in:
ringabout
2022-09-21 04:14:01 +08:00
committed by GitHub
parent 4a1bda667c
commit de70128fcc

View File

@@ -88,6 +88,66 @@ block:
doAssert y.b == {}
block:
type
X = object
a: string
b: int
var y = X(b: 1314)
reset(y)
doAssert y.b == 0
block:
type
X = object
a: string
b: float
var y = X(b: 1314.521)
reset(y)
doAssert y.b == 0.0
block:
type
X = object
a: string
b: string
var y = X(b: "1314")
reset(y)
doAssert y.b == ""
block:
type
X = object
a: string
b: seq[int]
var y = X(b: @[1, 3])
reset(y)
doAssert y.b == @[]
block:
type
X = object
a: string
b: tuple[a: int, b: string]
var y = X(b: (1, "cc"))
reset(y)
doAssert y.b == (0, "")
block:
type
Color = enum