io.standard-paths.unix: fixing the tests for Ubuntu.

db4
John Benediktsson 2014-04-22 07:40:57 -07:00
parent 15ab7fe82a
commit e7a74e0e61
1 changed files with 11 additions and 6 deletions

View File

@ -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
{ 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 can just make sure it runs.
{ } [ "ifconfig" find-in-path drop ] unit-test
! 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