Fix <process-writer> and <process-stream>
parent
a5efaa49a0
commit
0fd34b4a4b
|
@ -183,7 +183,7 @@ M: object run-pipeline-element
|
|||
[ |dispose drop ]
|
||||
[
|
||||
swap >process
|
||||
[ swap in>> or ] change-stdout
|
||||
[ swap in>> or ] change-stdin
|
||||
run-detached
|
||||
]
|
||||
[ in>> dispose ]
|
||||
|
@ -200,8 +200,8 @@ M: object run-pipeline-element
|
|||
[ [ |dispose drop ] bi@ ]
|
||||
[
|
||||
rot >process
|
||||
[ swap out>> or ] change-stdout
|
||||
[ swap in>> or ] change-stdin
|
||||
[ swap out>> or ] change-stdout
|
||||
run-detached
|
||||
]
|
||||
[ [ out>> dispose ] [ in>> dispose ] bi* ]
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
IN: io.unix.launcher.tests
|
||||
USING: io.files tools.test io.launcher arrays io namespaces
|
||||
continuations math io.encodings.binary io.encodings.ascii
|
||||
accessors kernel sequences io.encodings.utf8 destructors ;
|
||||
accessors kernel sequences io.encodings.utf8 destructors
|
||||
io.streams.duplex ;
|
||||
|
||||
[ ] [
|
||||
[ "launcher-test-1" temp-file delete-file ] ignore-errors
|
||||
|
@ -111,4 +112,12 @@ accessors kernel sequences io.encodings.utf8 destructors ;
|
|||
"append-test" temp-file utf8 file-contents
|
||||
] unit-test
|
||||
|
||||
[ ] [ "ls" utf8 <process-stream> contents drop ] unit-test
|
||||
[ t ] [ "ls" utf8 <process-stream> contents >boolean ] unit-test
|
||||
|
||||
[ "Hello world.\n" ] [
|
||||
"cat" utf8 <process-stream> [
|
||||
"Hello world.\n" write
|
||||
output-stream get dispose
|
||||
input-stream get contents
|
||||
] with-stream
|
||||
] unit-test
|
||||
|
|
Loading…
Reference in New Issue