]> diplodocus.org Git - nmh/blobdiff - test/mkstemp/test-mkstemp
Added const to arg of m_backup().
[nmh] / test / mkstemp / test-mkstemp
index 992a5864933695c31949afdf51614bde515b298f..084f649a7f8ff8ec0cea777d7c684741d4a2fabc 100755 (executable)
@@ -19,7 +19,7 @@ setup_test
 expected="$MH_TEST_DIR"/$$.expected
 actual="$MH_TEST_DIR"/$$.actual
 
-mkstemp="${MH_LIB_DIR}/mkstemp"
+mkstemp="${MH_LIBEXEC_DIR}/mkstemp"
 $mkstemp -help | grep suffix >/dev/null  &&  has_mkstemps=1  ||  has_mkstemps=0
 
 cd "$MHTMPDIR"
@@ -72,23 +72,26 @@ fi
 # check -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:
 check_tmpfile=`echo $tmpfile | grep "^$MHTMPDIR/......$" >/dev/null`
-run_test `echo $check_tmpfile` ''
+run_test 'eval echo $check_tmpfile' ''
 
 
 # check -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:
 check_tmpfile=`echo $tmpfile | grep '^mkstemptest......$' >/dev/null`
-run_test `echo $check_tmpfile` ''
+run_test 'eval echo $check_tmpfile' ''
 
 
 if [ $has_mkstemps -eq 1 ]; then
     # check -suffix
     tmpfile=`$mkstemp -suffix .txt`
     [ -f "$tmpfile" ]  &&  rm "$tmpfile"  ||  failed=`expr ${failed:-0} + 1`
+    # Rely on exit status of grep to detect failure and terminate due to set -e:
     check_tmpfile=`echo $tmpfile | grep '^......\.txt$' >/dev/null`
-    run_test `echo $check_tmpfile` ''
+    run_test 'eval echo $check_tmpfile' ''
 fi