X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/1f39b2d1b610c95e8bde939268c00f71a8e543ff..26c2b1ef1709cd7b34fe3e78995768a369e0f116:/test/mkstemp/test-mkstemp diff --git a/test/mkstemp/test-mkstemp b/test/mkstemp/test-mkstemp index 992a5864..e5a91b57 100755 --- a/test/mkstemp/test-mkstemp +++ b/test/mkstemp/test-mkstemp @@ -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