]> diplodocus.org Git - nmh/blobdiff - test/mhparam/test-mhparam
Add basic support for the STLS command in POP
[nmh] / test / mhparam / test-mhparam
index e2b9719036431886a4f2b0093042582d6fa1c232..1470cbaa8feca605ed5032ff01d7deaef2f50f55 100755 (executable)
@@ -38,7 +38,7 @@ Usage: mhparam [profile-components] [switches]
 EOF
 
 #### Skip nmh intro text.
-mhparam -help | sed '/^$/,$d' >"$actual" 2>&1
+mhparam -help 2>&1 | sed '/^$/,$d' >"$actual"
 check "$expected" "$actual"
 
 # check -version
@@ -172,27 +172,15 @@ aliases"
 start_test "nonexistent component"
 run_test 'mhparam nonexistent' ''
 
-# check that return status counts nonexistent components
-start_test "return status counts nonexistent components"
-set +e
-mhparam path context nonexistent1 nonexistent2 nonexistent3 >/dev/null
-run_test "echo $?" 3
-set -e
-
-# And clips their numbers to avoid a misleading exit value.
-start_test "clips their numbers to avoid a misleading exit value"
-while read use want; do
-    r=0
-    #### Heirloom shell can't handle the backquote expression as the
-    #### argument:   with set -e, it exits immediately.
-    textlines=`yes nonexistent | sed ${use}q`
-    mhparam $textlines || r=$?
-    run_test "echo $r" $want
-done <<\E
-119 119
-120 120
-121 120
-E
+# check that exit status notes nonexistent components
+start_test "exit status notes nonexistent components"
+for c in 'missing' 'path missing' 'missing path' 'missing missing'; do
+    set +e
+    mhparam $c >/dev/null
+    e=$?
+    set -e
+    run_test "echo $e" 1
+done
 
 # mhparam -debug
 start_test "-debug"