io.launcher: Bad usage of if-zero. Fixes #584.

db4
Doug Coleman 2012-07-25 23:17:46 -07:00
parent 2996ef41ff
commit a4d7a76143
2 changed files with 13 additions and 2 deletions

View File

@ -159,7 +159,7 @@ M: process-failed error.
] [ process>> . ] bi ;
: 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 -- )
run-process wait-for-success ;

View File

@ -2,7 +2,7 @@ USING: accessors arrays assocs calendar continuations
environment eval hashtables io io.directories
io.encodings.ascii io.files io.files.temp io.launcher
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
[ "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
try-process
] unit-test
! Regression
[ "asdfdontexistplzplz" >process wait-for-success ]
[
{
[ process-failed? ]
[ process>> process? ]
[ process>> command>> "asdfdontexistplzplz" = ]
[ process>> status>> f = ]
} 1&&
] must-fail-with