X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/96b4a2bc9d64b14a9dfd2b432a5de2fc17044933..24e7e9210b9b05d841e6935c40b0f737da6e99bc:/test/mkstemp/test-mkstemp diff --git a/test/mkstemp/test-mkstemp b/test/mkstemp/test-mkstemp index 8e0eb830..aec8baa8 100755 --- a/test/mkstemp/test-mkstemp +++ b/test/mkstemp/test-mkstemp @@ -29,6 +29,7 @@ cd "$MHTMPDIR" # check -help +start_test "-help" if [ $has_mkstemps -eq 1 ]; then cat >$expected <<-'EOF' Usage: mkstemp [switches] @@ -51,11 +52,12 @@ else fi #### Skip nmh intro text. -run_prog $mkstemp -h | sed '/^$/,$d' >"$actual" 2>&1 +run_prog $mkstemp -h 2>&1 | sed '/^$/,$d' >"$actual" check "$expected" "$actual" # check -version +start_test "-version" # Verified same behavior as compiled mhmail. case `$mkstemp -v` in mkstemp\ --*) ;; @@ -65,6 +67,7 @@ esac # check with no switches +start_test "with no switches" tmpfile=`$mkstemp` if [ -f "$tmpfile" ]; then rm "$tmpfile" @@ -74,6 +77,7 @@ fi # check -directory +start_test "-directory" tmpfile=`$mkstemp -directory "$MHTMPDIR"` [ -f "$tmpfile" ] && rm "$tmpfile" || failed=`expr ${failed:-0} + 1` # Rely on exit status of grep to detect failure and terminate due to set -e: @@ -82,6 +86,7 @@ run_test 'eval echo $check_tmpfile' '' # check -prefix +start_test "-prefix" tmpfile=`$mkstemp -prefix mkstemptest` [ -f "$tmpfile" ] && rm "$tmpfile" || failed=`expr ${failed:-0} + 1` # Rely on exit status of grep to detect failure and terminate due to set -e: @@ -99,4 +104,5 @@ if [ $has_mkstemps -eq 1 ]; then fi +finish_test exit $failed