1 IN: io.unix.launcher.tests
2 USING: io.files tools.test io.launcher arrays io namespaces
3 continuations math io.encodings.binary io.encodings.ascii
4 accessors kernel sequences io.encodings.utf8 destructors
8 [ "launcher-test-1" temp-file delete-file ] ignore-errors
13 "launcher-test-1" temp-file
18 [ t ] [ "launcher-test-1" temp-file exists? ] unit-test
21 [ "launcher-test-1" temp-file delete-file ] ignore-errors
26 "echo Hello" >>command
27 "launcher-test-1" temp-file >>stdout
33 "launcher-test-1" temp-file
35 ascii <process-reader> contents
39 [ "launcher-test-1" temp-file delete-file ] ignore-errors
46 "launcher-test-1" temp-file >>stdout
52 "launcher-test-1" temp-file
54 ascii <process-reader> contents
59 "launcher-test-1" temp-file binary <file-appender> [
62 "echo Hello" >>command
68 [ "Hello\nHello\n" ] [
70 "launcher-test-1" temp-file
72 ascii <process-reader> contents
78 { { "A" "B" } } >>environment
79 ascii <process-reader> lines
86 { { "A" "B" } } >>environment
87 +replace-environment+ >>environment-mode
88 ascii <process-reader> lines
93 [ "aloha" delete-file ] ignore-errors
95 { "echo" "hi" } >>command
99 temp-directory "aloha" append-path
103 [ "append-test" temp-file delete-file ] ignore-errors
109 "append-test" temp-file <appender> >>stdout
112 "append-test" temp-file utf8 file-contents
115 [ t ] [ "ls" utf8 <process-stream> contents >boolean ] unit-test
117 [ "Hello world.\n" ] [
118 "cat" utf8 <process-stream> [
119 "Hello world.\n" write
120 output-stream get dispose
121 input-stream get contents