From: David Dyck Date: Tue, 29 May 2001 22:05:28 +0000 (-0700) Subject: Re: [ID 20010529.003] find2perl and File::Find doesn't emulate find when path is... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=78eac027d0b109ebff3f99202cc1a91813238357;p=p5sagit%2Fp5-mst-13.2.git Re: [ID 20010529.003] find2perl and File::Find doesn't emulate find when path is a symlink (patch to t/lib/filefind.t as requested) Message-ID: p4raw-id: //depot/perl@10313 --- diff --git a/t/lib/filefind.t b/t/lib/filefind.t index de322f8..72e2669 100755 --- a/t/lib/filefind.t +++ b/t/lib/filefind.t @@ -9,7 +9,7 @@ BEGIN { @INC = '../lib'; } -if ( $symlink_exists ) { print "1..117\n"; } +if ( $symlink_exists ) { print "1..119\n"; } else { print "1..61\n"; } use File::Find; @@ -203,6 +203,15 @@ if ( $symlink_exists ) { File::Find::finddepth( {wanted => \&d_wanted, follow_fast => 1, no_chdir => 1},'fa' ); Check( scalar(keys %Expect) == 0 ); + + # Verify that File::Find::find will call wanted even if the topdir of + # is a symlink to a directory, and it shouldn't follow the link + # unless follow is set, which it isn't in this case + %Expect = ('fsl' => 1); + %Expect_Dir = (); + File::Find::find( {wanted => \&wanted, },'fa/fsl' ); + Check( scalar(keys %Expect) == 0 ); + } print "# of cases: $case\n";