From: Simon Ruderich Date: Thu, 13 Jun 2013 20:35:42 +0000 (+0200) Subject: tests/lib.sh: Fix tests for dash. X-Git-Tag: 0.1~49 X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=d5b84811d2f4bded83211984c839a096872608af;p=coloredstderr%2Fcoloredstderr.git tests/lib.sh: Fix tests for dash. --- diff --git a/tests/lib.sh b/tests/lib.sh index 897d50e..3427b56 100644 --- a/tests/lib.sh +++ b/tests/lib.sh @@ -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"