parent
bf1700bab1
commit
cebf7cdc1e
2 changed files with 21 additions and 3 deletions
18
tests/ccgbugs/t10128.nim
Normal file
18
tests/ccgbugs/t10128.nim
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# bug #10128
|
||||
let data = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"
|
||||
var seq2 = newSeq[char](data.len)
|
||||
for i in 0..<data.len:
|
||||
seq2[i] = data[i]
|
||||
|
||||
let c = '\128'
|
||||
|
||||
# case 1
|
||||
doAssert data[c.int] == 'y'
|
||||
doAssert seq2[c.int] == 'y'
|
||||
|
||||
proc play(x: openArray[char]) =
|
||||
doAssert x[c.int] == 'y'
|
||||
|
||||
# case2
|
||||
play(data)
|
||||
play(seq2)
|
||||
Loading…
Add table
Add a link
Reference in a new issue