]> ruderich.org/simon Gitweb - coloredstderr/coloredstderr.git/blobdiff - tests/lib.sh
Minor documentation update.
[coloredstderr/coloredstderr.git] / tests / lib.sh
index 27653f760908487ae64d793092daf4d02db00f03..3427b5608fc36cdf7dca0824fbca4b4f97979f73 100644 (file)
@@ -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"