From de70128fccba242af9b0c6fa0840d03d3566e58d Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Wed, 21 Sep 2022 04:14:01 +0800 Subject: [PATCH] follow up #19968; add more tests (#20396) --- tests/stdlib/tsystem.nim | 60 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/tests/stdlib/tsystem.nim b/tests/stdlib/tsystem.nim index a90a1d1d9f..5efc9fd38d 100644 --- a/tests/stdlib/tsystem.nim +++ b/tests/stdlib/tsystem.nim @@ -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