2011-11-09 11:33:19 +04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
source tests-common.sh
|
|
|
|
|
|
|
|
inherit eutils
|
|
|
|
|
|
|
|
test-path_exists() {
|
|
|
|
local exp=$1; shift
|
2011-12-16 10:22:42 +04:00
|
|
|
tbegin "path_exists($*) == ${exp}"
|
2011-11-09 11:33:19 +04:00
|
|
|
path_exists "$@"
|
|
|
|
[[ ${exp} -eq $? ]]
|
2011-12-16 10:22:42 +04:00
|
|
|
tend $?
|
2011-11-09 11:33:19 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
test-path_exists 1
|
|
|
|
test-path_exists 1 -a
|
|
|
|
test-path_exists 1 -o
|
|
|
|
|
|
|
|
good="/ . tests-common.sh /bin/bash"
|
|
|
|
test-path_exists 0 ${good}
|
|
|
|
test-path_exists 0 -a ${good}
|
|
|
|
test-path_exists 0 -o ${good}
|
|
|
|
|
|
|
|
bad="/asjdkfljasdlfkja jlakjdsflkasjdflkasdjflkasdjflaskdjf"
|
|
|
|
test-path_exists 1 ${bad}
|
|
|
|
test-path_exists 1 -a ${bad}
|
|
|
|
test-path_exists 1 -o ${bad}
|
|
|
|
|
|
|
|
test-path_exists 1 ${good} ${bad}
|
|
|
|
test-path_exists 1 -a ${good} ${bad}
|
|
|
|
test-path_exists 0 -o ${good} ${bad}
|
|
|
|
|
2011-12-16 10:22:42 +04:00
|
|
|
texit
|