X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=tests%2Flib.sh;h=3427b5608fc36cdf7dca0824fbca4b4f97979f73;hb=217e8c8bc5fa8c22221514a320d6edeb1c2a101f;hp=27653f760908487ae64d793092daf4d02db00f03;hpb=59375c2b7949791d8cad8e5cebde2649bac83ec8;p=coloredstderr%2Fcoloredstderr.git diff --git a/tests/lib.sh b/tests/lib.sh index 27653f7..3427b56 100644 --- a/tests/lib.sh +++ b/tests/lib.sh @@ -88,7 +88,7 @@ run_test() { export COLORED_STDERR_PRE export COLORED_STDERR_POST # And force writes to a file (unless we are testing the force). - if test "x$force_write" != x; then + if test -n "$force_write"; then COLORED_STDERR_FORCE_WRITE=1 export COLORED_STDERR_FORCE_WRITE fi @@ -105,7 +105,9 @@ run_test() { test_script() { testcase="$1" expected="$2" - shift; shift || true + # shift || true is not enough for dash. + test $# -ge 2 && shift + shift if test -z "$expected"; then expected="$testcase" @@ -118,7 +120,8 @@ test_script_subshell() { test_program() { testcase="$1" expected="$2" - shift; shift || true + test $# -ge 2 && shift + shift if test -z "$expected"; then expected="$testcase"