This commit is contained in:
2026-01-25 19:02:02 +01:00
parent a830238d11
commit 1ee28a1644
92 changed files with 10955 additions and 621 deletions
+16
View File
@@ -0,0 +1,16 @@
// retoor <retoor@molodetz.nl>
import "subprocess" for Popen
var p1 = Popen.new(["echo", "test"])
System.print(p1.pid > 0) // expect: true
var out1 = p1.stdout.read()
System.print(out1.trim()) // expect: test
System.print(p1.wait()) // expect: 0
var p2 = Popen.new(["cat"])
p2.stdin.write("hello")
p2.stdin.close()
var out2 = p2.stdout.read()
System.print(out2) // expect: hello
System.print(p2.wait()) // expect: 0
+9
View File
@@ -0,0 +1,9 @@
// retoor <retoor@molodetz.nl>
import "subprocess" for Popen
var p = Popen.new(["echo", "hello"])
var output = p.stdout.read()
System.print(output.trim()) // expect: hello
var code = p.wait()
System.print(code) // expect: 0
+11
View File
@@ -0,0 +1,11 @@
// retoor <retoor@molodetz.nl>
import "subprocess" for Popen
var p = Popen.new(["sh"], true)
System.print(p.pid > 0) // expect: true
p.stdin.write("echo pty_test\n")
p.stdin.write("exit\n")
var out = p.stdout.read()
System.print(out.contains("pty_test")) // expect: true
System.print(p.wait()) // expect: 0