]> gitweb.factorcode.org Git - factor.git/commitdiff
io.launcher: Bad usage of if-zero. Fixes #584.
authorDoug Coleman <doug.coleman@gmail.com>
Thu, 26 Jul 2012 06:17:46 +0000 (23:17 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Thu, 26 Jul 2012 06:17:46 +0000 (23:17 -0700)
basis/io/launcher/launcher.factor
basis/io/launcher/windows/windows-tests.factor

index 06cd72b23ae033edf450495fac16d7317f86a152..79fb29b770974565db8b47c767450617efe56f32 100755 (executable)
@@ -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 ;
index 1f3c5ff264005dad48d9ce3906a9d85836df0a77..628b783b898818b5e3e5cefb12daec3688c47fd1 100644 (file)
@@ -2,7 +2,7 @@ USING: accessors arrays assocs calendar continuations
 environment eval hashtables io io.directories\r
 io.encodings.ascii io.files io.files.temp io.launcher\r
 io.launcher.windows io.pathnames kernel math namespaces parser\r
-sequences splitting system tools.test ;\r
+sequences splitting system tools.test combinators.short-circuit ;\r
 IN: io.launcher.windows.tests\r
 \r
 [ "hello world" ] [ { "hello" "world" } join-arguments ] unit-test\r
@@ -230,3 +230,14 @@ IN: io.launcher.windows.tests
     "vocab:io/launcher/windows/test/input.txt" >>stdin\r
     try-process\r
 ] unit-test\r
+\r
+! Regression\r
+[ "asdfdontexistplzplz" >process wait-for-success ]\r
+[\r
+    {\r
+        [ process-failed? ]\r
+        [ process>> process? ]\r
+        [ process>> command>> "asdfdontexistplzplz" = ]\r
+        [ process>> status>> f = ]\r
+    } 1&&\r
+] must-fail-with
\ No newline at end of file