* don't zero out in a move in the VM * Add testcases for #17199 * Update tests/arc/tarcmisc.nim Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> * Update tests/vm/tissues.nim Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> * Fix test failures * Fix test * Fix tests Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
This commit is contained in:
parent
e3e9742143
commit
bb3769975b
3 changed files with 63 additions and 18 deletions
|
|
@ -390,3 +390,35 @@ proc newPixelBuffer(): PixelBuffer =
|
|||
|
||||
discard newPixelBuffer()
|
||||
|
||||
|
||||
# bug #17199
|
||||
|
||||
proc passSeq(data: seq[string]) =
|
||||
# used the system.& proc initially
|
||||
let wat = data & "hello"
|
||||
|
||||
proc test2 =
|
||||
let name = @["hello", "world"]
|
||||
passSeq(name)
|
||||
doAssert name == @["hello", "world"]
|
||||
|
||||
static: test2() # was buggy
|
||||
test2()
|
||||
|
||||
proc merge(x: sink seq[string], y: sink string): seq[string] =
|
||||
newSeq(result, x.len + 1)
|
||||
for i in 0..x.len-1:
|
||||
result[i] = move(x[i])
|
||||
result[x.len] = move(y)
|
||||
|
||||
proc passSeq2(data: seq[string]) =
|
||||
# used the system.& proc initially
|
||||
let wat = merge(data, "hello")
|
||||
|
||||
proc test3 =
|
||||
let name = @["hello", "world"]
|
||||
passSeq2(name)
|
||||
doAssert name == @["hello", "world"]
|
||||
|
||||
static: test3() # was buggy
|
||||
test3()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue