summary refs log tree commit diff stats
path: root/tests/destructor
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-06-26 19:34:05 +0200
committerAndreas Rumpf <rumpf_a@web.de>2019-06-26 19:34:05 +0200
commite083a1533b40ed768b2085852b714ea8e5564f4f (patch)
treef05cdff70c0ef7be93ac225962ad760cae012a63 /tests/destructor
parentf288e1b11ab3c796b213fe139f6dcb9c1897218f (diff)
downloadNim-e083a1533b40ed768b2085852b714ea8e5564f4f.tar.gz
fixes #11098
Diffstat (limited to 'tests/destructor')
-rw-r--r--tests/destructor/tgcdestructors.nim14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/destructor/tgcdestructors.nim b/tests/destructor/tgcdestructors.nim
index e0f973ecc..36dec9326 100644
--- a/tests/destructor/tgcdestructors.nim
+++ b/tests/destructor/tgcdestructors.nim
@@ -7,7 +7,9 @@ ha
 @[1, 2, 3]
 @["red", "yellow", "orange", "rtrt1", "pink"]
 a: @[4, 2, 3]
-35 35'''
+0
+30
+41 41'''
 """
 
 import allocators
@@ -178,6 +180,16 @@ proc mutConstSeq() =
 
 mutConstSeq()
 
+proc mainSeqOfCap =
+  # bug #11098
+  var s = newSeqOfCap[int](10)
+  echo s.len
+
+  var s2 = newSeqUninitialized[int](30)
+  echo s2.len
+
+mainSeqOfCap()
+
 #echo s
 let (a, d) = allocCounters()
 discard cprintf("%ld %ld\n", a, d)