summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/arc/topt_no_cursor.nim2
-rw-r--r--tests/misc/taddr.nim11
-rw-r--r--tests/vm/tconstobj.nim20
3 files changed, 20 insertions, 13 deletions
diff --git a/tests/arc/topt_no_cursor.nim b/tests/arc/topt_no_cursor.nim
index d5811e91e..3d37e6269 100644
--- a/tests/arc/topt_no_cursor.nim
+++ b/tests/arc/topt_no_cursor.nim
@@ -46,7 +46,7 @@ var
   lvalue
   lnext
   _
-`=copy`(lresult, [123])
+lresult = @[123]
 _ = (
   let blitTmp = lresult
   blitTmp, ";")
diff --git a/tests/misc/taddr.nim b/tests/misc/taddr.nim
index 17fccfabe..49a577798 100644
--- a/tests/misc/taddr.nim
+++ b/tests/misc/taddr.nim
@@ -103,17 +103,6 @@ block:
     doAssert byLent(a2) == (11,)
 
   block:
-    when (defined(c) or defined(cpp)) and defined(release):
-      discard # probably not a bug since optimizer is free to pass by value, and `unsafeAddr` is used
-    else:
-      var a = @[12]
-      doAssert byPtr(a)[] == @[12]
-      let a2 = [13]
-      doAssert byPtr(a2)[] == [13]
-      let a3 = 14
-      doAssert byPtr(a3)[] == 14
-
-  block:
     proc byLent2[T](a: seq[T]): lent T = a[1]
     var a = @[20,21,22]
     doAssert byLent2(a) == 21
diff --git a/tests/vm/tconstobj.nim b/tests/vm/tconstobj.nim
index 93d0e1d7d..7dc20a0ba 100644
--- a/tests/vm/tconstobj.nim
+++ b/tests/vm/tconstobj.nim
@@ -3,6 +3,7 @@ discard """
 (name: "hello")
 (-1, 0)
 (FirstName: "James", LastName: "Franco")
+[1, 2, 3]
 '''
 """
 
@@ -74,4 +75,21 @@ static: # issue #11861
 
 static: # issue #15662
   proc a(T: typedesc) = echo T.type
-  a((int, int))
\ No newline at end of file
+  a((int, int))
+
+# bug #16069
+type
+  E = enum
+    val1, val2
+  Obj = object
+    case k: E
+    of val1:
+      x: array[3, int]
+    of val2:
+      y: uint32
+
+const
+  foo = [1, 2, 3]
+  arr = Obj(k: val1, x: foo)
+
+echo arr.x