tmemlinesBuf.nim 260 B

12345678910
  1. import std/[memfiles, assertions]
  2. var inp = memfiles.open("tests/stdlib/tmemlinesBuf.nim")
  3. var buffer: string = ""
  4. var lineCount = 0
  5. for line in lines(inp, buffer):
  6. lineCount += 1
  7. close(inp)
  8. doAssert lineCount == 9, $lineCount # this file's number of lines