]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: mktemp -t: $TMPDIR has higher priority than -p
authorSylvestre Ledru <sylvestre@debian.org>
Mon, 3 Jul 2023 21:37:11 +0000 (23:37 +0200)
committerPádraig Brady <P@draigBrady.com>
Tue, 4 Jul 2023 11:11:16 +0000 (12:11 +0100)
* tests/misc/mktemp.pl: Ensure that with -t,
$TMPDIR has precedence over -p.

tests/misc/mktemp.pl

index 52f262b588863f54b8a2dac65c4eb349add02607..01dcf61497e35cbaa1756dcac458d776224292ab 100755 (executable)
@@ -183,6 +183,12 @@ my @Tests =
        check_tmp $f, 'F'; unlink $f; rmdir 'a' or die "rmdir a: $!\n" }}
      ],
 
+     ['priority-t-tmpdir', "-t -p $bad_dir foo.XXX",
+      {ENV=>"TMPDIR=."},
+      {OUT_SUBST => 's,....$,.ZZZ,'},
+      {OUT => "./foo.ZZZ\n"},
+     ],
+
      ['pipe-bad-tmpdir',
       {ENV => "TMPDIR=$bad_dir"},
       {ERR_SUBST => "s,($bad_dir/)[^']+': .*,\$1...,"},