t10128.nim 536 B

123456789101112131415161718
  1. # bug #10128
  2. let data = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"
  3. var seq2 = newSeq[char](data.len)
  4. for i in 0..<data.len:
  5. seq2[i] = data[i]
  6. let c = '\128'
  7. # case 1
  8. doAssert data[c.int] == 'y'
  9. doAssert seq2[c.int] == 'y'
  10. proc play(x: openArray[char]) =
  11. doAssert x[c.int] == 'y'
  12. # case2
  13. play(data)
  14. play(seq2)