Skip to content

Commit a4d7a76

Browse files
committed
io.launcher: Bad usage of if-zero. Fixes #584.
1 parent 2996ef4 commit a4d7a76

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

basis/io/launcher/launcher.factor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ M: process-failed error.
159159
] [ process>> . ] bi ;
160160

161161
: wait-for-success ( process -- )
162-
dup wait-for-process [ drop ] [ process-failed ] if-zero ;
162+
dup wait-for-process 0 = [ drop ] [ process-failed ] if ;
163163

164164
: try-process ( desc -- )
165165
run-process wait-for-success ;

basis/io/launcher/windows/windows-tests.factor

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ USING: accessors arrays assocs calendar continuations
22
environment eval hashtables io io.directories
33
io.encodings.ascii io.files io.files.temp io.launcher
44
io.launcher.windows io.pathnames kernel math namespaces parser
5-
sequences splitting system tools.test ;
5+
sequences splitting system tools.test combinators.short-circuit ;
66
IN: io.launcher.windows.tests
77

88
[ "hello world" ] [ { "hello" "world" } join-arguments ] unit-test
@@ -230,3 +230,14 @@ IN: io.launcher.windows.tests
230230
"vocab:io/launcher/windows/test/input.txt" >>stdin
231231
try-process
232232
] unit-test
233+
234+
! Regression
235+
[ "asdfdontexistplzplz" >process wait-for-success ]
236+
[
237+
{
238+
[ process-failed? ]
239+
[ process>> process? ]
240+
[ process>> command>> "asdfdontexistplzplz" = ]
241+
[ process>> status>> f = ]
242+
} 1&&
243+
] must-fail-with

0 commit comments

Comments
 (0)