6 @INC = qw(: ::lib ::macos:lib);
11 require Config; import Config;
12 if ($Config{'extensions'} !~ /\bFile\/Glob\b/i) {
19 print "not ok 1\n" unless $loaded;
23 *CORE::GLOBAL::glob = sub { "Just another Perl hacker," };
27 if ("Just another Perl hacker," ne (<*>)[0]) {
29 Your version of perl ($]) doesn't seem to allow extensions to override
30 the core glob operator.
35 use File::Glob ':globally';
39 $_ = $^O eq "MacOS" ? ":lib:*.t" : "lib/*.t";
41 print "not " if $_ ne ($^O eq "MacOS" ? ":lib:*.t" : "lib/*.t");
44 # we should have at least basic.t, global.t, taint.t
45 print "# |@r|\nnot " if @r < 3;
48 # check if <*/*> works
54 # at least t/global.t t/basic.t, t/taint.t
55 print "not " if @r < 3;
59 # check if scalar context works
62 while (defined($_ = <:*:*.t>)) {
67 while (defined($_ = <*/*.t>)) {
72 print "not " if @r != $r;
75 # check if list context works
88 print "not " if @r != $r;
91 # test if implicit assign to $_ in while() works
104 print "not " if @r != $r;
107 # test if explicit glob() gets assign magic too
109 while (glob($^O eq 'MacOS' ? ':*:*.t' : '*/*.t')) {
113 print "not " if "@r" ne "@s";
116 # how about in a different package, like?
118 use File::Glob ':globally';
120 while (glob($^O eq 'MacOS' ? ':*:*.t' : '*/*.t')) {
124 print "not " if "@r" ne "@s";
127 # test if different glob ops maintain independent contexts
130 if ($^O eq "MacOS") {
134 while (<:bas*:*.t>) {
151 print "not " if "@r" ne "@s" or not $i;