summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorJacek Sieka <arnetheduck@gmail.com>2016-03-23 22:29:28 +0800
committerJacek Sieka <arnetheduck@gmail.com>2016-03-23 22:29:28 +0800
commit266e40f27eeb6a8b6bff7ac06a541e16fddda496 (patch)
treecf2ac271a35e7e5eaaa71f08403286b14b2ba4cc /tests
parentd1b2c35897fd2b94000827e84fd69e06d14bedb3 (diff)
downloadNim-266e40f27eeb6a8b6bff7ac06a541e16fddda496.tar.gz
add test for shallow seq copy
currently looks like it's not covered
Diffstat (limited to 'tests')
-rw-r--r--tests/seq/tshallowseq.nim17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/seq/tshallowseq.nim b/tests/seq/tshallowseq.nim
new file mode 100644
index 000000000..9a8bdb954
--- /dev/null
+++ b/tests/seq/tshallowseq.nim
@@ -0,0 +1,17 @@
+discard """
+  output: '''@[1, 42, 3]
+@[1, 42, 3]
+'''
+"""
+proc xxx() =
+  var x: seq[int] = @[1, 2, 3]
+  var y: seq[int]
+
+  system.shallowCopy(y, x)
+
+  y[1] = 42
+
+  echo y
+  echo x
+
+xxx()