io.launcher: Bad usage of if-zero. Fixes #584.
parent
2996ef41ff
commit
a4d7a76143
|
@ -159,7 +159,7 @@ M: process-failed error.
|
||||||
] [ process>> . ] bi ;
|
] [ process>> . ] bi ;
|
||||||
|
|
||||||
: wait-for-success ( process -- )
|
: wait-for-success ( process -- )
|
||||||
dup wait-for-process [ drop ] [ process-failed ] if-zero ;
|
dup wait-for-process 0 = [ drop ] [ process-failed ] if ;
|
||||||
|
|
||||||
: try-process ( desc -- )
|
: try-process ( desc -- )
|
||||||
run-process wait-for-success ;
|
run-process wait-for-success ;
|
||||||
|
|
|
@ -2,7 +2,7 @@ USING: accessors arrays assocs calendar continuations
|
||||||
environment eval hashtables io io.directories
|
environment eval hashtables io io.directories
|
||||||
io.encodings.ascii io.files io.files.temp io.launcher
|
io.encodings.ascii io.files io.files.temp io.launcher
|
||||||
io.launcher.windows io.pathnames kernel math namespaces parser
|
io.launcher.windows io.pathnames kernel math namespaces parser
|
||||||
sequences splitting system tools.test ;
|
sequences splitting system tools.test combinators.short-circuit ;
|
||||||
IN: io.launcher.windows.tests
|
IN: io.launcher.windows.tests
|
||||||
|
|
||||||
[ "hello world" ] [ { "hello" "world" } join-arguments ] unit-test
|
[ "hello world" ] [ { "hello" "world" } join-arguments ] unit-test
|
||||||
|
@ -230,3 +230,14 @@ IN: io.launcher.windows.tests
|
||||||
"vocab:io/launcher/windows/test/input.txt" >>stdin
|
"vocab:io/launcher/windows/test/input.txt" >>stdin
|
||||||
try-process
|
try-process
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
|
! Regression
|
||||||
|
[ "asdfdontexistplzplz" >process wait-for-success ]
|
||||||
|
[
|
||||||
|
{
|
||||||
|
[ process-failed? ]
|
||||||
|
[ process>> process? ]
|
||||||
|
[ process>> command>> "asdfdontexistplzplz" = ]
|
||||||
|
[ process>> status>> f = ]
|
||||||
|
} 1&&
|
||||||
|
] must-fail-with
|
Loading…
Reference in New Issue