From 0dedd13253f4e3fc4ddaf912f503b30261d2ee63 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 17 Sep 2019 06:00:14 -0500 Subject: Allow --tmpdir's argument to be optional. --- tests/mktemp.test | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'tests') 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" "" "" -- cgit v1.2.3