tnewstring_uninitialized.nim 177 B

123456789101112
  1. discard """
  2. matrix: "--mm:refc;"
  3. """
  4. # bug #22555
  5. var x = newStringUninit(10)
  6. doAssert x.len == 10
  7. for i in 0..<x.len:
  8. x[i] = chr(ord('a') + i)
  9. doAssert x == "abcdefghij"