mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 18:02:05 +00:00
16 lines
345 B
Nim
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 |