summaryrefslogtreecommitdiff
path: root/ext/File-Find
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2019-07-22 15:47:57 +1000
committerTony Cook <tony@develop-help.com>2019-07-22 15:47:57 +1000
commitcfb8d85df6ebf8495bf2f9a43a9b70bf0ccb37fd (patch)
treef6ea504a506b13f215e63f1eb22521b70f9d2126 /ext/File-Find
parent33617017c38f4e15c84e1fd29b4ce48e5d28be6c (diff)
downloadperl-cfb8d85df6ebf8495bf2f9a43a9b70bf0ccb37fd.tar.gz
File-Find/t/find.t: reindent after adding a SKIP block
Diffstat (limited to 'ext/File-Find')
-rw-r--r--ext/File-Find/t/find.t76
1 files changed, 38 insertions, 38 deletions
diff --git a/ext/File-Find/t/find.t b/ext/File-Find/t/find.t
index bca797e8ca..0a7355296c 100644
--- a/ext/File-Find/t/find.t
+++ b/ext/File-Find/t/find.t
@@ -1028,47 +1028,47 @@ if ($^O eq 'MSWin32') {
closedir $ROOT_DIR;
SKIP:
{
- my $created_file;
- unless (defined $expected_first_file) {
- $expected_first_file = '__perl_File_Find_test.tmp';
- open(F, ">", "/$expected_first_file") && close(F)
- or skip "cannot create file in root directory: $!", 8;
- $created_file = 1;
- }
+ my $created_file;
+ unless (defined $expected_first_file) {
+ $expected_first_file = '__perl_File_Find_test.tmp';
+ open(F, ">", "/$expected_first_file") && close(F)
+ or skip "cannot create file in root directory: $!", 8;
+ $created_file = 1;
+ }
- # Run F:F:f with/without no_chdir for each possible style of root path.
- # NB. If HOME were "/", then an inadvertent chdir('') would fluke the
- # expected result, so ensure it is something else:
- local $ENV{HOME} = $orig_dir;
- foreach my $no_chdir (0, 1) {
- foreach my $root_dir ("/", "\\", "$drive/", "$drive\\") {
- eval {
- File::Find::find({
- 'no_chdir' => $no_chdir,
- 'preprocess' => sub { return sort @_ },
- 'wanted' => sub {
- -f or return; # the first call is for $root_dir itself.
- my $got = $File::Find::name;
- my $exp = "$root_dir$expected_first_file";
- print "# no_chdir=$no_chdir $root_dir '$got'\n";
- is($got, $exp,
- "Win32: Run 'find' with 'no_chdir' set to $no_chdir" );
- die "done"; # do not process the entire drive!
- },
- }, $root_dir);
- };
- # If F:F:f did not die "done" then it did not Check() either.
- unless ($@ and $@ =~ /done/) {
- print "# no_chdir=$no_chdir $root_dir ",
- ($@ ? "error: $@" : "no files found"), "\n";
- ok(0, "Win32: 0");
+ # Run F:F:f with/without no_chdir for each possible style of root path.
+ # NB. If HOME were "/", then an inadvertent chdir('') would fluke the
+ # expected result, so ensure it is something else:
+ local $ENV{HOME} = $orig_dir;
+ foreach my $no_chdir (0, 1) {
+ foreach my $root_dir ("/", "\\", "$drive/", "$drive\\") {
+ eval {
+ File::Find::find({
+ 'no_chdir' => $no_chdir,
+ 'preprocess' => sub { return sort @_ },
+ 'wanted' => sub {
+ -f or return; # the first call is for $root_dir itself.
+ my $got = $File::Find::name;
+ my $exp = "$root_dir$expected_first_file";
+ print "# no_chdir=$no_chdir $root_dir '$got'\n";
+ is($got, $exp,
+ "Win32: Run 'find' with 'no_chdir' set to $no_chdir" );
+ die "done"; # do not process the entire drive!
+ },
+ }, $root_dir);
+ };
+ # If F:F:f did not die "done" then it did not Check() either.
+ unless ($@ and $@ =~ /done/) {
+ print "# no_chdir=$no_chdir $root_dir ",
+ ($@ ? "error: $@" : "no files found"), "\n";
+ ok(0, "Win32: 0");
+ }
}
}
- }
- if ($created_file) {
- unlink("/$expected_first_file")
- or warn "can't unlink /$expected_first_file: $!\n";
- }
+ if ($created_file) {
+ unlink("/$expected_first_file")
+ or warn "can't unlink /$expected_first_file: $!\n";
+ }
}
}