Lines Matching full:find
16 # This is a hack - at present File::Find does not produce native names
18 # must be set *before* importing File::Find
40 use File::Find;
43 my %Expect_Name = (); # what we expect for $File::Find::name/fullname
44 my %Expect_Dir = (); # what we expect for $File::Find::dir
53 # Uncomment this to see where File::Find is chdir-ing to. Helpful for
70 # Do find() and finddepth() work correctly with an empty list of
73 ok(eval { find(\&noop_wanted); 1 },
74 "'find' successfully returned for an empty list of directories");
80 # Do find() and finddepth() work correctly in the directory
81 # from which we start? (Test presumes the presence of 'find.t' in same
85 find({wanted => sub { ++$count_found if $_ eq 'find.t'; } },
87 is($count_found, 1, "'find' found exactly 1 file named 'find.t'");
90 finddepth({wanted => sub { ++$count_found if $_ eq 'find.t'; } },
92 is($count_found, 1, "'finddepth' found exactly 1 file named 'find.t'");
165 print "# \$File::Find::dir => '$File::Find::dir'\t\$_ => '$_'\n";
181 $File::Find::prune = 1 if $_ eq 'faba';
185 my $n = $File::Find::name;
187 print "# \$File::Find::name => '$n'\n";
193 ok( $OK, "found $n for \$File::Find::name, as expected" );
210 print "# \$File::Find::dir => '$File::Find::dir'\n";
219 print "# \$File::Find::dir => '$File::Find::dir' \n";
223 delete $Expect_Dir{ $File::Find::dir }->{$file};
226 is(scalar(keys %{$Expect_Dir{ $File::Find::dir }}), 0,
228 if (scalar(keys %{$Expect_Dir{ $File::Find::dir }}) == 0) {
229 delete $Expect_Dir{ $File::Find::dir }
235 print "# postprocess: \$File::Find::dir => '$File::Find::dir' \n";
236 delete $Expect_Dir{ $File::Find::dir};
240 # find/finddepth. Historically topdir() differed on Mac OS classic.
245 # $File::Find::Name (%Expect_Name). Note: When the no_chdir => 1
246 # option is in effect, $_ is the same as $File::Find::Name. In that
289 # Do find() and finddepth() correctly warn on invalid options?
292 # ext/File-Find/t/taint by moving into the temporary testing directory
304 find(
339 ##### Basic tests for find() #####
340 # Set up list of files we expect to find.
341 # Run find(), removing a file from the list once we have found it.
357 File::Find::find( {wanted => \&wanted_File_Dir_prune}, topdir('fa') );
358 is( scalar(keys %Expect_File), 0, "COMPLETE: Basic test of find()" );
378 File::Find::find( {wanted => sub { wanted_File_Dir_prune();
379 File::Find::find( {wanted => sub
383 is( scalar(keys %Expect_File), 0, "COMPLETE: Test of find() for re-entrancy" );
411 File::Find::find( {wanted => \&wanted_File_Dir, no_chdir => 1},
415 ##### Test for $File::Find::name #####
436 File::Find::finddepth( {wanted => \&wanted_Name}, File::Spec->curdir );
437 is( scalar(keys %Expect_Name), 0, "COMPLETE: Test for \$File::Find::name" );
463 File::Find::finddepth( {wanted => \&wanted_File, no_chdir => 1},
467 "COMPLETE: Equivalency of \$_ and \$File::Find::Name with 'no_chdir'" );
484 File::Find::find( {wanted => \&noop_wanted,
504 File::Find::find( {wanted => \&noop_wanted,
517 File::Find::find( sub { } , 'fa' ) for @foo;
549 File::Find::find( sub { $true_count++; $_{$_}++; &_; } , 'fa' ) for @foo;
569 # Verify that File::Find::find will call wanted even if the topdir
575 File::Find::find( {wanted => \&wanted_File_Dir}, topdir('fa', 'fsl') );
595 File::Find::find( {wanted => \&wanted_File_Dir_prune,
628 File::Find::find( {wanted => \&wanted_File_Dir, follow_fast => 1,
653 File::Find::finddepth( {wanted => \&wanted_Name,
657 "COMPLETE: test of 'follow_fast' option: \$File::Find::name case" );
680 File::Find::finddepth( {wanted => \&wanted_File, follow_fast => 1,
684 "COMPLETE: Test of 'follow_fast' and 'no_chdir' options together: \$File::Find::name case" );
720 File::Find::find( {wanted => \&wanted_File, follow => 1,
740 eval {File::Find::find( {wanted => \&simple_wanted, follow => 1,
754 eval {File::Find::finddepth( {wanted => \&simple_wanted,
794 File::Find::finddepth( {wanted => \&wanted_File_Dir, follow => 1,
806 eval {File::Find::find( {wanted => \&simple_wanted, follow => 1,
819 eval {File::Find::find( {wanted => \&simple_wanted, follow => 1,
859 File::Find::find( {wanted => \&wanted_File_Dir, follow => 1,
911 File::Find::find( {wanted => \&wanted_File_Dir}, topdir('fa'));
936 File::Find::find( {wanted => \&wanted_File_Dir, no_chdir => 1}, $volume . topdir('fa'));
958 File::Find::find (
977 File::Find::find( {wanted => sub {
980 ok(-e $File::Find::fullname,
984 $File::Find::fullname,
1013 if ( $File::Find::name =~ m/match/ ) {
1018 find( \&wantmatch, (
1027 find( \&wantmatch, (
1073 File::Find::find({
1078 my $got = $File::Find::name;
1082 "Win32: Run 'find' with 'no_chdir' set to $no_chdir" );
1104 eval { File::Find::find( 'foobar' ); };
1106 "find() correctly died for lack of &wanted via either coderef or hashref");
1111 eval { File::Find::find( { follow => 1 } ); };
1113 "find() correctly died for lack of &wanted via hashref");
1118 eval { File::Find::find( { wanted => 1 } ); };
1120 "find() correctly died: lack of coderef as value of 'wanted' element");
1126 eval { File::Find::find( $wanted, ( undef ) ); };
1128 "find() correctly died due to undefined top directory");