diff options
author | Rob Landley <rob@landley.net> | 2019-09-17 06:00:14 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2019-09-17 06:00:14 -0500 |
commit | 0dedd13253f4e3fc4ddaf912f503b30261d2ee63 (patch) | |
tree | 1088306acbfab223bd4af9bf3ba6421a61e38127 /tests | |
parent | 861d1c76cd2ddf3c2feab0cd439f325b96541610 (diff) | |
download | toybox-0dedd13253f4e3fc4ddaf912f503b30261d2ee63.tar.gz |
Allow --tmpdir's argument to be optional.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/mktemp.test | 12 |
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" "" "" |