Files
Nim/tests/osproc/tstdin.nim
2014-06-15 12:57:05 +01:00

16 lines
345 B
Nim

discard """
file: "tstdin.nim"
output: "10"
"""
import osproc, os, streams
doAssert fileExists(getCurrentDir() / "tests" / "osproc" / "ta.exe")
var p = startProcess("ta.exe", getCurrentDir() / "tests" / "osproc")
p.inputStream.write("5\n")
while true:
let line = p.outputStream.readLine()
if line != "":
echo line
else:
break