} else {
$expected = $_ = "op/a*.t";
}
-$_ = "op/a*.t";
my @r = glob;
print "not " if $_ ne $expected;
print "ok 1\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, $_;
}
# 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";
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";