Files
Nim/tests/osproc/tstdin.nim
2018-12-11 21:23:21 +01:00

18 lines
393 B
Nim

discard """
output: "10"
"""
import osproc, os, streams
const filename = when defined(Windows): "ta_in.exe" else: "ta_in"
doAssert fileExists(getCurrentDir() / "tests" / "osproc" / filename)
var p = startProcess(filename, getCurrentDir() / "tests" / "osproc")
p.inputStream.write("5\n")
p.inputStream.flush()
var line = ""
while p.outputStream.readLine(line.TaintedString):
echo line