summary refs log tree commit diff stats
path: root/tests/macros/tprintf.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/macros/tprintf.nim')
-rw-r--r--tests/macros/tprintf.nim16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/macros/tprintf.nim b/tests/macros/tprintf.nim
new file mode 100644
index 000000000..c8fb51cdc
--- /dev/null
+++ b/tests/macros/tprintf.nim
@@ -0,0 +1,16 @@
+discard """
+  file: "tprintf.nim"
+  output: "Andreas Rumpf"
+"""
+# Test a printf proc

+

+proc printf(file: TFile, args: openarray[string]) =

+  var i = 0

+  while i < args.len:

+    write(file, args[i])

+    inc(i)

+

+printf(stdout, ["Andreas ", "Rumpf\n"])

+#OUT Andreas Rumpf

+
+