]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
mktemp: enhance test to catch just-fixed typo behavior
authorEric Blake <ebb9@byu.net>
Thu, 5 Nov 2009 15:36:09 +0000 (08:36 -0700)
committerEric Blake <ebb9@byu.net>
Thu, 5 Nov 2009 20:12:33 +0000 (13:12 -0700)
Penance for botching the conflict resolution while rebasing my series.

* tests/misc/mktemp (check_tmp): Test for the bug when wrong parameter
is used.

tests/misc/mktemp

index 7735f33d1973c1aff6ae53103062aaff732869f7..e49643f349b965e9b6ae7484029c59a638da8f74 100755 (executable)
@@ -85,9 +85,10 @@ my @Tests =
 
      # Use a template consisting solely of X's
      ['1d-allX', '-d XXXX', {OUT => "ZZZZ\n"},
+      {PRE => sub {mkdir 'XXXX',0755 or die "XXXX: $!\n"}},
       {OUT_SUBST => 's,^....$,ZZZZ,'},
       {POST => sub { my ($f) = @_; defined $f or return; chomp $f;
-       check_tmp $f, 'D'; }}
+       check_tmp $f, 'D'; rmdir 'XXXX' or die "rmdir XXXX: $!\n"; }}
      ],
 
      # Test -u