]> ruderich.org/simon Gitweb - coloredstderr/coloredstderr.git/commitdiff
tests/lib.sh: Fix tests for dash.
authorSimon Ruderich <simon@ruderich.org>
Thu, 13 Jun 2013 20:35:42 +0000 (22:35 +0200)
committerSimon Ruderich <simon@ruderich.org>
Thu, 13 Jun 2013 20:35:42 +0000 (22:35 +0200)
tests/lib.sh

index 897d50e754ca38a4fe5bc6658b0a1217e8217818..3427b5608fc36cdf7dca0824fbca4b4f97979f73 100644 (file)
@@ -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"