From adb3a15d2135c6da9abaf1c19376e84de874d05f Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Sat, 22 Sep 2012 10:30:10 -0700 Subject: [PATCH] io.launcher.unix: fix tests to use arch in file names. --- basis/io/launcher/unix/unix-tests.factor | 45 +++++++++++++----------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/basis/io/launcher/unix/unix-tests.factor b/basis/io/launcher/unix/unix-tests.factor index 1df90f8900..0a98c80c58 100644 --- a/basis/io/launcher/unix/unix-tests.factor +++ b/basis/io/launcher/unix/unix-tests.factor @@ -1,65 +1,68 @@ +USING: accessors arrays bootstrap.image calendar +concurrency.promises continuations debugger.unix destructors io +io.backend.unix io.directories io.encodings.ascii +io.encodings.binary io.encodings.utf8 io.files io.files.temp +io.launcher io.launcher.unix io.pathnames io.streams.duplex +io.timeouts kernel locals math namespaces sequences threads +tools.test unix unix.process ; IN: io.launcher.unix.tests -USING: io.backend.unix io.files io.files.temp io.directories -io.pathnames tools.test io.launcher arrays io namespaces -continuations math io.encodings.binary io.encodings.ascii -accessors kernel sequences io.encodings.utf8 destructors -io.streams.duplex locals concurrency.promises threads -unix.process calendar unix debugger.unix io.timeouts -io.launcher.unix ; + +: arch-temp-file ( str -- str' ) + "-" my-arch 3append temp-file ; [ ] [ - [ "launcher-test-1" temp-file delete-file ] ignore-errors + [ "launcher-test-1" arch-temp-file delete-file ] ignore-errors ] unit-test [ ] [ "touch" - "launcher-test-1" temp-file + "launcher-test-1" arch-temp-file 2array try-process ] unit-test -[ t ] [ "launcher-test-1" temp-file exists? ] unit-test +[ t ] [ "launcher-test-1" arch-temp-file exists? ] unit-test [ ] [ - [ "launcher-test-1" temp-file delete-file ] ignore-errors + [ "launcher-test-1" arch-temp-file delete-file ] ignore-errors ] unit-test [ ] [ "echo Hello" >>command - "launcher-test-1" temp-file >>stdout + "launcher-test-1" arch-temp-file >>stdout try-process ] unit-test [ "Hello\n" ] [ "cat" - "launcher-test-1" temp-file + "launcher-test-1" arch-temp-file 2array ascii stream-contents ] unit-test [ ] [ - [ "launcher-test-1" temp-file delete-file ] ignore-errors + [ "launcher-test-1" arch-temp-file delete-file ] ignore-errors ] unit-test [ ] [ "cat" >>command +closed+ >>stdin - "launcher-test-1" temp-file >>stdout + "launcher-test-1" arch-temp-file >>stdout try-process ] unit-test [ "" ] [ "cat" - "launcher-test-1" temp-file + "launcher-test-1" arch-temp-file 2array ascii stream-contents ] unit-test [ ] [ 2 [ - "launcher-test-1" temp-file binary [ + "launcher-test-1" arch-temp-file binary [ swap >>stdout "echo Hello" >>command @@ -70,7 +73,7 @@ io.launcher.unix ; [ "Hello\nHello\n" ] [ "cat" - "launcher-test-1" temp-file + "launcher-test-1" arch-temp-file 2array ascii stream-contents ] unit-test @@ -103,16 +106,16 @@ io.launcher.unix ; utf8 file-contents ] unit-test -[ "append-test" temp-file delete-file ] ignore-errors +[ "append-test" arch-temp-file delete-file ] ignore-errors [ "hi\nhi\n" ] [ 2 [ "echo hi" >>command - "append-test" temp-file >>stdout + "append-test" arch-temp-file >>stdout try-process ] times - "append-test" temp-file utf8 file-contents + "append-test" arch-temp-file utf8 file-contents ] unit-test [ t ] [ "ls" utf8 stream-contents >boolean ] unit-test