treadln.nim 474 B

12345678910111213141516171819202122
  1. discard """
  2. output: '''
  3. test the improved readline handling that does not care whether its
  4. Macintosh, Unix or Windows text format.
  5. '''
  6. """
  7. # test the improved readline handling that does not care whether its
  8. # Macintosh, Unix or Windows text format.
  9. var
  10. inp: File
  11. line: string
  12. if open(inp, "tests/misc/treadln.nim"):
  13. while not endOfFile(inp):
  14. line = readLine(inp)
  15. if line.len >= 2 and line[0] == '#' and line[1] == ' ':
  16. echo line[2..^1]
  17. close(inp)