diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/run.scm | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/tests/run.scm b/tests/run.scm index 98b6c25..c4ab584 100644 --- a/tests/run.scm +++ b/tests/run.scm @@ -1,12 +1,27 @@ (module scsh-tests () -(import chicken scheme) - -#;(include "../scsh-process.scm") -(use scsh-process) - -(use test utils extras ports files posix - srfi-13 srfi-18 (only setup-api version>=?)) +(import scheme) + +(cond-expand + (chicken-5 (import (chicken base) (chicken port) (chicken condition) + (chicken io) (chicken file) (chicken file posix) + (chicken process signal) + (chicken fixnum) ;; Why is this needed?! + srfi-18 test) + #;(include "../scsh-process.scm") + (import scsh-process) + + (define (read-all #!optional file-or-port) + (cond ((string? file-or-port) + (with-input-from-file file-or-port read-string)) + (file-or-port (read-string #f file-or-port)) + (else (read-string)))) + ) + (else (import chicken) + #;(include "../scsh-process.scm") + (use scsh-process) + (use test utils extras ports files posix + srfi-13 srfi-18 (only setup-api version>=?)))) (test-begin "scsh-process") @@ -116,11 +131,11 @@ (test "Appending to a file" '("blah" "foo") (begin (run (echo foo) (>> ,tmpfile)) - (read-lines tmpfile))) + (with-input-from-file tmpfile read-lines))) (let ((message "testing, 1 2 3")) (test "Redirecting from object" - `("blah" "foo" ,(string-delete #\t message)) + `("blah" "foo" ,"esing, 1 2 3") (run/strings (pipe (epf (tr -d t) (<< ,message)) (cat ,tmpfile -))))) (delete-file* tmpfile))) @@ -129,7 +144,9 @@ (test "run/string with begin form" "hi, there\n" (run/string (pipe (begin (print "hi, there")) (cat)))) - (when (version>=? (chicken-version) "4.8.1") + (when (cond-expand + (chicken-5 #t) + (else (version>=? (chicken-version) "4.8.1"))) (let ((child? #f)) (thread-start! (lambda () (thread-sleep! 0.5) |