]> diplodocus.org Git - nmh/blobdiff - test/mhpath/test-mhpath
Handle teen ordinal suffixes correctly.
[nmh] / test / mhpath / test-mhpath
index 9bb1207acaf80fc8ebb89fe6d764b5c1a08f4010..c6521ce3d0181e122641c9a5aadff69b55b76c49 100755 (executable)
@@ -16,6 +16,8 @@ fi
 
 setup_test
 
+check_exit '-eq 1' mhpath -
+
 expected=$MH_TEST_DIR/$$.expected
 actual=$MH_TEST_DIR/$$.actual
 
@@ -28,9 +30,9 @@ Usage: mhpath [+folder] [msgs] [switches]
   -help
 EOF
 
-# check -help
-mhpath -help > $actual 2>&1
-check $expected $actual
+#### Skip nmh intro text.
+run_prog mhpath -help 2>&1 | sed '/^$/,$d' >"$actual"
+check "$expected" "$actual"
 
 # check -version
 case `mhpath -v` in
@@ -62,7 +64,7 @@ $MH_TEST_DIR/Mail/inbox/8
 $MH_TEST_DIR/Mail/inbox/9
 $MH_TEST_DIR/Mail/inbox/10
 EOF
-mhpath all > $actual 2>&1
+run_prog mhpath all > $actual 2>&1
 check $expected $actual
 
 # check message number greater than highest
@@ -82,7 +84,7 @@ $MH_TEST_DIR/Mail/inbox/8
 $MH_TEST_DIR/Mail/inbox/9
 $MH_TEST_DIR/Mail/inbox/10
 EOF
-mhpath 1-99999 > $actual 2>&1
+run_prog mhpath 1-99999 > $actual 2>&1
 check $expected $actual
 
 # check new
@@ -94,7 +96,7 @@ $MH_TEST_DIR/Mail/inbox/1
 $MH_TEST_DIR/Mail/inbox/10
 $MH_TEST_DIR/Mail/inbox/11
 EOF
-mhpath first last new > $actual 2>&1
+run_prog mhpath first last new > $actual 2>&1
 check $expected $actual
 
 # check invalid message list using names
@@ -125,15 +127,15 @@ cat > $expected <<EOF
 $MH_TEST_DIR/Mail/inbox/3
 $MH_TEST_DIR/Mail/inbox/4
 EOF
-mhpath first:2 > $actual 2>&1
+run_prog mhpath first:2 > $actual 2>&1
 check $expected $actual
 
-# check reference to non-existant messages
+# check reference to non-existent messages
 cat > $expected <<EOF
 $MH_TEST_DIR/Mail/inbox/1
 $MH_TEST_DIR/Mail/inbox/2
 EOF
-mhpath 1 2 > $actual 2>&1
+run_prog mhpath 1 2 > $actual 2>&1
 check $expected $actual