From d5b84811d2f4bded83211984c839a096872608af Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Thu, 13 Jun 2013 22:35:42 +0200 Subject: [PATCH] tests/lib.sh: Fix tests for dash. --- tests/lib.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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" -- 2.45.2