summary refs log tree commit diff stats
path: root/tests/osproc/tstdin.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/osproc/tstdin.nim')
-rw-r--r--tests/osproc/tstdin.nim16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/osproc/tstdin.nim b/tests/osproc/tstdin.nim
new file mode 100644
index 000000000..2ea939992
--- /dev/null
+++ b/tests/osproc/tstdin.nim
@@ -0,0 +1,16 @@
+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
\ No newline at end of file