Merge pull request #3996 from arnetheduck/tshallowseq

add test for shallow seq copy
This commit is contained in:
Andreas Rumpf
2016-03-23 17:13:46 +01:00

17
tests/seq/tshallowseq.nim Normal file
View File

@@ -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()