X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FFile%2FDosGlob.t;h=625d107ebe5e07a1744b8545774505a74b0217d0;hb=35c0985d87e203a100f5c5fc6518bee6a2e2fd9d;hp=d55c00ef1a1bed68b9f9150eadc31c9c5b6d8ef5;hpb=be708cc0141c68546a70e3d19f68ad41bef15add;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/File/DosGlob.t b/lib/File/DosGlob.t index d55c00e..625d107 100755 --- a/lib/File/DosGlob.t +++ b/lib/File/DosGlob.t @@ -17,11 +17,10 @@ use File::DosGlob 'glob'; # test if $_ takes as the default my $expected; if ($^O eq 'MacOS') { - $expected = $_ = ":lib:a*.t"; + $expected = $_ = ":op:a*.t"; } else { - $expected = $_ = "lib/a*.t"; + $expected = $_ = "op/a*.t"; } -$_ = "op/a*.t"; my @r = glob; print "not " if $_ ne $expected; print "ok 1\n"; @@ -94,7 +93,8 @@ print "ok 7\n"; package Foo; use File::DosGlob 'glob'; @s = (); -while (glob '*/a*.t') { +$pat = $^O eq 'MacOS' ? ':*:a*.t' : '*/a*.t'; +while (glob($pat)) { print "# $_\n"; push @s, $_; } @@ -103,15 +103,28 @@ print "ok 8\n"; # test if different glob ops maintain independent contexts @s = (); -while (<*/a*.t>) { - my $i = 0; - print "# $_ <"; - push @s, $_; - while (<*/b*.t>) { - print " $_"; - $i++; +if ($^O eq 'MacOS') { + while (<:*:a*.t>) { + my $i = 0; + print "# $_ <"; + push @s, $_; + while (<:*:b*.t>) { + print " $_"; + $i++; + } + print " >\n"; + } +} else { + while (<*/a*.t>) { + my $i = 0; + print "# $_ <"; + push @s, $_; + while (<*/b*.t>) { + print " $_"; + $i++; + } + print " >\n"; } - print " >\n"; } print "not " if "@r" ne "@s"; print "ok 9\n"; @@ -121,15 +134,28 @@ eval <<'EOT'; use File::DosGlob 'GLOBAL_glob'; package Bar; @s = (); -while (<*/a*.t>) { - my $i = 0; - print "# $_ <"; - push @s, $_; - while (glob '*/b*.t') { - print " $_"; - $i++; +if ($^O eq 'MacOS') { + while (<:*:a*.t>) { + my $i = 0; + print "# $_ <"; + push @s, $_; + while (glob ':*:b*.t') { + print " $_"; + $i++; + } + print " >\n"; + } +} else { + while (<*/a*.t>) { + my $i = 0; + print "# $_ <"; + push @s, $_; + while (glob '*/b*.t') { + print " $_"; + $i++; + } + print " >\n"; } - print " >\n"; } print "not " if "@r" ne "@s"; print "ok 10\n";