summary refs log tree commit diff stats
path: root/tests/stdlib/treadln.nim
blob: 4a070e848e3882b90c948fee2618bfcf814bfacd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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)