From ca747cf3bd3fbbdd4f9c2b13d8bdc5e69daf8a24 Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Sat, 6 Oct 2012 19:12:21 +0200 Subject: Provide a new 'wait' procedure so we don't need to modify the type of process-wait, which could lead to trouble in user code when compiled with scrutiny and/or specialization. This procedure returns the values in a different order for ease of use. May be a bit confusing... --- tests/run.scm | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/run.scm b/tests/run.scm index 56a823e..ae12600 100644 --- a/tests/run.scm +++ b/tests/run.scm @@ -7,13 +7,13 @@ (test-group "Procedural interface" (test "Fork/pipe \"hello world\" example from SCSH reference manual" - "Hello, world." - (begin (process-wait - (fork/pipe + '(0 #t "Hello, world.") + (receive (exit-status exited-ok? pid) + (wait (fork/pipe (lambda () (with-output-to-port (open-output-file* 1) (lambda () (display "Hello, world.\n")))))) - (read-line (open-input-file* 0)))) + (list exit-status exited-ok? (read-line (open-input-file* 0))))) (test "run/string* returns a string output in a subprocess" "This is a test" (run/string* (lambda () (display "This is a test")))) @@ -127,8 +127,7 @@ ;; TODO: Find a way to test that the input port didn't get replaced by ;; one from a subshell. This happened before, but not sure how ;; to detect this except running it manually from the REPL. - (test-error "No more zombies lying around after we're done" - (process-wait))) + (test-error "No more zombies lying around after we're done" (wait))) (test-end) -- cgit v1.2.3