summaryrefslogtreecommitdiff
path: root/test/start
diff options
context:
space:
mode:
Diffstat (limited to 'test/start')
-rwxr-xr-xtest/start9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/start b/test/start
index 4cf0d9d..c750310 100755
--- a/test/start
+++ b/test/start
@@ -24,15 +24,16 @@ check() {
try() {
# shellcheck disable=SC2016
- printf 'TEST: PATH="$PATH:%s" %s, expect %s\n' "$@"
+ printf 'TEST: PATH="%s:$PATH:%s" %s, expect %s\n' "${PWD%/test}" "$@"
PATH="$PATH:$1" "$2" 2>&1 | check "$3"
# shellcheck disable=SC2016
- printf 'TEST: PATH="%s:$PATH" %s, expect %s\n' "$@"
+ printf 'TEST: PATH="%s:%s:$PATH" %s, expect %s\n' "${PWD%/test}" "$@"
PATH="$1:$PATH" "$2" 2>&1 | check "$3"
}
do_try() {
try "$1" "$2/x" "$3"
+ try "$1" "$2//x" "$3"
try "$1" "./$2/x" "$3"
try "$1" "$PWD/$2/x" "$3"
try "$1" "$2/../$2/x" "$3"
@@ -41,12 +42,13 @@ do_try() {
echo
}
+# use do_try2 if x in PATH
do_try2() {
try "$1" "x" "$3"
do_try "$@"
}
-export PATH="$PWD/..:$PATH"
+export PATH="${PWD%/test}:$PATH"
do_try "" a "a err"
do_try2 "$PWD/a" a "a err"
@@ -55,5 +57,6 @@ do_try2 "$PWD/a:$PWD/b" a "a b err"
do_try "$PWD/a:$PWD/b" b "b err"
do_try2 "$PWD/a:$PWD/b:$PWD/c" a "a b c"
do_try "$PWD/a:$PWD/b:$PWD/c" b "b c"
+do_try2 "$PWD/a:$PWD/a" a "a err"
echo "ALL TESTS COMPLETED SUCCESSFULLY :)"