From: Collin Funk Date: Fri, 15 May 2026 03:58:39 +0000 (-0700) Subject: test: mktemp: test creation of a directory with a subdirectory template X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=91cd3f7a1872dcdaefb6dade1a35ddbc642d4ad4;p=thirdparty%2Fcoreutils.git test: mktemp: test creation of a directory with a subdirectory template * tests/mktemp/mktemp.pl (@Tests): Remove an unlink call handled in the previous call to check_tmp. Add a test case. --- diff --git a/tests/mktemp/mktemp.pl b/tests/mktemp/mktemp.pl index c137f8eba7..42b053aee0 100755 --- a/tests/mktemp/mktemp.pl +++ b/tests/mktemp/mktemp.pl @@ -174,13 +174,22 @@ my @Tests = check_tmp $f, 'F'; }}], - # Test template with subdirectory - ['tmp-w-slash', '--tmpdir=. a/bXXXX', + # Test creation of a file where the template has a subdirectory. + ['tmp-w-slash1', '--tmpdir=. a/bXXXX', {PRE => sub {mkdir 'a',0755 or die "a: $!\n"}}, {OUT_SUBST => 's,b....$,bZZZZ,'}, {OUT => "./a/bZZZZ\n"}, {POST => sub { my ($f) = @_; defined $f or return; chomp $f; - check_tmp $f, 'F'; unlink $f; rmdir 'a' or die "rmdir a: $!\n" }} + check_tmp $f, 'F'; rmdir 'a' or die "rmdir a: $!\n" }} + ], + + # Likewise, but create a directory. + ['tmp-w-slash2', '--tmpdir=. -d a/bXXXX', + {PRE => sub {mkdir 'a',0755 or die "a: $!\n"}}, + {OUT_SUBST => 's,b....$,bZZZZ,'}, + {OUT => "./a/bZZZZ\n"}, + {POST => sub { my ($f) = @_; defined $f or return; chomp $f; + check_tmp $f, 'D'; rmdir 'a' or die "rmdir a: $!\n" }} ], ['priority-t-tmpdir', "-t -p $bad_dir foo.XXX",