summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2022-09-21 04:14:01 +0800
committerGitHub <noreply@github.com>2022-09-20 16:14:01 -0400
commitde70128fccba242af9b0c6fa0840d03d3566e58d (patch)
tree11ae7c9edf24e00437da8813c5a0e5b2bc52ab1d /tests
parent4a1bda667c74361c121460ca7d80cfcbf003d8d7 (diff)
downloadNim-de70128fccba242af9b0c6fa0840d03d3566e58d.tar.gz
follow up #19968; add more tests (#20396)
Diffstat (limited to 'tests')
-rw-r--r--tests/stdlib/tsystem.nim60
1 files changed, 60 insertions, 0 deletions
diff --git a/tests/stdlib/tsystem.nim b/tests/stdlib/tsystem.nim
index a90a1d1d9..5efc9fd38 100644
--- a/tests/stdlib/tsystem.nim
+++ b/tests/stdlib/tsystem.nim
@@ -90,6 +90,66 @@ block:
 
 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
       Red, Blue, Yellow
     X = object