]> diplodocus.org Git - nmh/blobdiff - test/mhparam/test-mhparam
Tweaked to work with Heirloom shell.
[nmh] / test / mhparam / test-mhparam
index d838d688ce5c5b7ce72cb525cccd21d013712207..a2130ba7f08655223e14589728165837d72ca06a 100755 (executable)
@@ -16,8 +16,8 @@ fi
 
 setup_test
 
 
 setup_test
 
-mhparam - >/dev/null 2>&1 || true  # gcov
-mhparam localmbox >/dev/null 2>&1 || true  # gcov
+check_exit '-eq 1' mhparam -
+check_exit '-eq 0' mhparam localmbox
 
 expected=$MH_TEST_DIR/$$.expected
 expected_err=$MH_TEST_DIR/$$.expected_err
 
 expected=$MH_TEST_DIR/$$.expected
 expected_err=$MH_TEST_DIR/$$.expected_err
@@ -165,6 +165,17 @@ mhparam path context nonexistent1 nonexistent2 nonexistent3 >/dev/null
 run_test "echo $?" 3
 set -e
 
 run_test "echo $?" 3
 set -e
 
+# And clips their numbers to avoid a misleading exit value.
+while read use want; do
+    r=0
+    mhparam `yes nonexistent | sed ${use}q` || r=$?
+    run_test "echo $r" $want
+done <<\E
+119 119
+120 120
+121 120
+E
+
 # mhparam -debug
 # Some of its output depends on configure options, so don't bother to
 # check for correctness here.
 # mhparam -debug
 # Some of its output depends on configure options, so don't bother to
 # check for correctness here.