From e7a74e0e61137a47e78f04b921f4dc3935bba640 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Tue, 22 Apr 2014 07:40:57 -0700 Subject: [PATCH] io.standard-paths.unix: fixing the tests for Ubuntu. --- basis/io/standard-paths/unix/unix-tests.factor | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/basis/io/standard-paths/unix/unix-tests.factor b/basis/io/standard-paths/unix/unix-tests.factor index 7e5f5c5504..c161d5e03f 100644 --- a/basis/io/standard-paths/unix/unix-tests.factor +++ b/basis/io/standard-paths/unix/unix-tests.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2011 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: io.standard-paths io.standard-paths.unix sequences -tools.test ; +USING: environment io.standard-paths io.standard-paths.unix +sequences tools.test ; IN: io.standard-paths.unix.tests { f } [ "" find-in-path ] unit-test @@ -9,7 +9,12 @@ IN: io.standard-paths.unix.tests "ls" find-in-path { "/bin/ls" "/usr/bin/ls" } member? ] unit-test -! On Ubuntu, the path is ``/sbin/ifconfig``, however -! find-in-path uses the PATH environment variable which does -! not include this directory. So we can just make sure it runs. -{ } [ "ifconfig" find-in-path drop ] unit-test +{ t } [ + ! On Ubuntu, the path is ``/sbin/ifconfig``, however + ! find-in-path uses the PATH environment variable which does + ! not include this directory, so we do. + "/sbin:" "PATH" os-env append "PATH" [ + "ifconfig" find-in-path + { "/sbin/ifconfig" "/usr/bin/ifconfig" } member? + ] with-os-env +] unit-test