1 USING: io.launcher tools.test calendar accessors environment
2 namespaces kernel system arrays io io.files io.encodings.ascii
3 sequences parser assocs hashtables math continuations eval ;
4 IN: io.launcher.windows.nt.tests
13 [ f ] [ "notepad" get process-running? ] unit-test
15 [ f ] [ "notepad" get process-started? ] unit-test
17 [ ] [ "notepad" [ run-detached ] change ] unit-test
19 [ "notepad" get wait-for-process ] must-fail
21 [ t ] [ "notepad" get killed>> ] unit-test
23 [ f ] [ "notepad" get process-running? ] unit-test
27 vm "-quiet" "-run=hello-world" 3array >>command
28 "out.txt" temp-file >>stdout
33 "out.txt" temp-file ascii file-lines first
38 vm "-run=listener" 2array >>command
44 "resource:basis/io/windows/nt/launcher/test" [
46 vm "-script" "stderr.factor" 3array >>command
47 "out.txt" temp-file >>stdout
48 "err.txt" temp-file >>stderr
54 "out.txt" temp-file ascii file-lines first
58 "err.txt" temp-file ascii file-lines first
62 "resource:basis/io/windows/nt/launcher/test" [
64 vm "-script" "stderr.factor" 3array >>command
65 "out.txt" temp-file >>stdout
72 "out.txt" temp-file ascii file-lines first
76 "resource:basis/io/windows/nt/launcher/test" [
78 vm "-script" "stderr.factor" 3array >>command
79 "err2.txt" temp-file >>stderr
80 ascii <process-reader> lines first
85 "err2.txt" temp-file ascii file-lines first
89 "resource:basis/io/windows/nt/launcher/test" [
91 vm "-script" "env.factor" 3array >>command
92 ascii <process-reader> contents
99 "resource:basis/io/windows/nt/launcher/test" [
101 vm "-script" "env.factor" 3array >>command
102 +replace-environment+ >>environment-mode
103 os-envs >>environment
104 ascii <process-reader> contents
105 ] with-directory eval
111 "resource:basis/io/windows/nt/launcher/test" [
113 vm "-script" "env.factor" 3array >>command
114 { { "A" "B" } } >>environment
115 ascii <process-reader> contents
116 ] with-directory eval
122 "resource:basis/io/windows/nt/launcher/test" [
124 vm "-script" "env.factor" 3array >>command
125 { { "USERPROFILE" "XXX" } } >>environment
126 +prepend-environment+ >>environment-mode
127 ascii <process-reader> contents
128 ] with-directory eval
130 "USERPROFILE" swap at "XXX" =
136 "cmd.exe /c dir" >>command
137 "dir.txt" temp-file >>stdout
141 [ ] [ "dir.txt" temp-file delete-file ] unit-test
144 [ "append-test" temp-file delete-file ] ignore-errors
146 [ "Hello appender\r\nHello appender\r\n" ] [
148 "resource:basis/io/windows/nt/launcher/test" [
150 vm "-script" "append.factor" 3array >>command
151 "append-test" temp-file <appender> >>stdout
156 "append-test" temp-file ascii file-contents