summary refs log tree commit diff stats
path: root/tests/arc/tstrformat.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/arc/tstrformat.nim')
-rw-r--r--tests/arc/tstrformat.nim22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/arc/tstrformat.nim b/tests/arc/tstrformat.nim
new file mode 100644
index 000000000..641f323da
--- /dev/null
+++ b/tests/arc/tstrformat.nim
@@ -0,0 +1,22 @@
+discard """
+  output: '''
+verstuff
+'''
+  cmd: "nim c --gc:arc $file"
+"""
+
+# bug #13622
+
+import strformat
+
+template necho*(args: string) {.dirty.} =
+  if getCurrentException() != nil:
+    echo args
+  else:
+    stdout.writeLine(args)
+
+proc main(cond: bool; arg: string) =
+  if cond:
+    necho &"ver{arg}\n"
+
+main(true, "stuff")