aboutsummaryrefslogtreecommitdiff
path: root/tests/mktemp.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/mktemp.test')
-rwxr-xr-xtests/mktemp.test12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/mktemp.test b/tests/mktemp.test
index 9715be5d..adf8666e 100755
--- a/tests/mktemp.test
+++ b/tests/mktemp.test
@@ -16,11 +16,17 @@ testing "-t TEMPLATE uses \$TMPDIR" "TMPDIR=/t mktemp -u -t hello.XXXXXXXX | gre
testing "-t and TEMPLATE but no \$TMPDIR uses /tmp" "TMPDIR= mktemp -u -t hello.XXXXXXXX | grep -q '^/tmp/hello\.........$' && echo yes" "yes\n" "" ""
testing "-p DIR and TEMPLATE should use DIR" "TMPDIR=/t mktemp -u -p DIR hello.XXXXXXXX | grep -q '^DIR/hello\.........$' && echo yes" "yes\n" "" ""
testing "-p DIR and -t: -t wins" "TMPDIR=/t mktemp -u -p DIR -t hello.XXXXXXXX | grep -q '^/t/hello\.........$' && echo yes" "yes\n" "" ""
-testing "-p DIR -t TEMPLATE but no \$TMPDIR (DIR wins)" "TMPDIR= mktemp -u -p DIR -t hello.XXXXXXXX | grep -q '^DIR/hello\.........$' && echo yes" "yes\n" "" ""
+testing "-p DIR -t TEMPLATE but no \$TMPDIR (DIR wins)" "TMPDIR= mktemp -u -p DIR -t hello.XXXXXXXX | grep -q '^DIR/hello\.........\$' && echo yes" "yes\n" "" ""
testing "-u doesn't need to be able to write to dir" \
- "mktemp -u -p /proc | grep -q '^/proc/tmp\...........$' && echo yes" "yes\n" \
+ "mktemp -u -p /proc | grep -q '^/proc/tmp\...........\$' && echo yes" "yes\n" \
"" ""
-testing "needs at least XX in template" \
+testing "needs at least XXX in template" \
"mktemp -u helloX 2>/dev/null || echo error" "error\n" "" ""
testing "-q shouldn't print path" \
"mktemp -p /proc -q || echo only-failure" "only-failure\n" "" ""
+testing "--tmpdir doesn't need argument" \
+ "TMPDIR= mktemp -u helloXXX --tmpdir | grep -q '^/tmp/hello...\$' && echo yes" \
+ "yes\n" "" ""
+testing "--tmpdir can have argument" \
+ "TMPDIR= mktemp -u helloXXX --tmpdir=abc | grep -q '^abc/hello...\$' && echo yes" \
+ "yes\n" "" ""