summary refs log tree commit diff stats
path: root/tests/system/tnewstring_uninitialized.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/system/tnewstring_uninitialized.nim')
-rw-r--r--tests/system/tnewstring_uninitialized.nim11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/system/tnewstring_uninitialized.nim b/tests/system/tnewstring_uninitialized.nim
new file mode 100644
index 000000000..9bc0e1622
--- /dev/null
+++ b/tests/system/tnewstring_uninitialized.nim
@@ -0,0 +1,11 @@
+discard """
+  matrix: "--mm:refc;"
+"""
+
+# bug #22555
+var x = newStringUninit(10)
+doAssert x.len == 10
+for i in 0..<x.len:
+  x[i] = chr(ord('a') + i)
+
+doAssert x == "abcdefghij"