summary refs log tree commit diff stats
path: root/tests/stdlib/treadln.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/stdlib/treadln.nim')
-rw-r--r--tests/stdlib/treadln.nim23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/stdlib/treadln.nim b/tests/stdlib/treadln.nim
new file mode 100644
index 000000000..4a070e848
--- /dev/null
+++ b/tests/stdlib/treadln.nim
@@ -0,0 +1,23 @@
+
+discard """
+output: '''
+test the improved readline handling that does not care whether its
+Macintosh, Unix or Windows text format.
+'''
+"""
+
+import std/syncio
+
+# test the improved readline handling that does not care whether its
+# Macintosh, Unix or Windows text format.
+
+var
+  inp: File
+  line: string
+
+if open(inp, "tests/stdlib/treadln.nim"):
+  while not endOfFile(inp):
+    line = readLine(inp)
+    if line.len >= 2 and line[0] == '#' and line[1] == ' ':
+      echo line[2..^1]
+  close(inp)