summaryrefslogtreecommitdiff
path: root/lib/File/DosGlob.t
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-09-26 12:53:16 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-09-26 12:53:16 +0000
commitbe708cc0141c68546a70e3d19f68ad41bef15add (patch)
tree5152acd08116f8ae5a5d576f678fde267a91bcb7 /lib/File/DosGlob.t
parentd1f145d342e491f3bdc2d057c6771a7a5baba14a (diff)
downloadperl-be708cc0141c68546a70e3d19f68ad41bef15add.tar.gz
Integrate macperl changes from Chris Nandor:
12192 11817 11815 11813 11778 11775 Update CPAN.pm to work with new Mac::BuildTools instead of ExtUtils::MM_MacOS "orphan" functions Fix test Make syntax check report in MPW style, fix tests to use Mac::err=unix to get normal-style error messages. More module and test ports from Thomas Wegner et al Fix open of /dev/null for Mac OS Allow for platforms to override formatting of errors on output from Matthias Neeracher (core files) p4raw-id: //depot/perl@12235 p4raw-edited: from //depot/maint-5.6/macperl@12234 'edit in' lib/File/DosGlob.pm t/op/magic.t (@11007..) p4raw-integrated: from //depot/maint-5.6/macperl@12234 'copy in' lib/File/Spec/Mac.pm lib/File/Temp.pm (@11007..) 'merge in' ext/File/Glob/Glob.pm lib/CPAN.pm (@11007..) ext/File/Glob/bsd_glob.c t/base/term.t (@11185..) t/op/runlevel.t (@11198..) t/pod/testp2pt.pl (@11500..) p4raw-integrated: from //depot/maint-5.6/macperl@11815 'merge in' perl.c (@11806..) p4raw-integrated: from //depot/maint-5.6/macperl@11775 'merge in' perl.h pp_ctl.c util.c (@11007..)
Diffstat (limited to 'lib/File/DosGlob.t')
-rwxr-xr-xlib/File/DosGlob.t47
1 files changed, 36 insertions, 11 deletions
diff --git a/lib/File/DosGlob.t b/lib/File/DosGlob.t
index 31e36e24dc..d55c00ef1a 100755
--- a/lib/File/DosGlob.t
+++ b/lib/File/DosGlob.t
@@ -15,23 +15,33 @@ print "1..10\n";
use File::DosGlob 'glob';
# test if $_ takes as the default
+my $expected;
+if ($^O eq 'MacOS') {
+ $expected = $_ = ":lib:a*.t";
+} else {
+ $expected = $_ = "lib/a*.t";
+}
$_ = "op/a*.t";
my @r = glob;
-print "not " if $_ ne 'op/a*.t';
+print "not " if $_ ne $expected;
print "ok 1\n";
print "# |@r|\nnot " if @r < 9;
print "ok 2\n";
# check if <*/*> works
-@r = <*/a*.t>;
+if ($^O eq 'MacOS') {
+ @r = <:*:a*.t>;
+} else {
+ @r = <*/a*.t>;
+}
# atleast {argv,abbrev,anydbm,autoloader,append,arith,array,assignwarn,auto}.t
-print "not " if @r < 9;
+print "# |@r|\nnot " if @r < 9;
print "ok 3\n";
my $r = scalar @r;
# check if scalar context works
@r = ();
-while (defined($_ = <*/a*.t>)) {
+while (defined($_ = ($^O eq 'MacOS') ? <:*:a*.t> : <*/a*.t>)) {
print "# $_\n";
push @r, $_;
}
@@ -40,25 +50,40 @@ print "ok 4\n";
# check if list context works
@r = ();
-for (<*/a*.t>) {
- print "# $_\n";
- push @r, $_;
+if ($^O eq 'MacOS') {
+ for (<:*:a*.t>) {
+ print "# $_\n";
+ push @r, $_;
+ }
+} else {
+ for (<*/a*.t>) {
+ print "# $_\n";
+ push @r, $_;
+ }
}
print "not " if @r != $r;
print "ok 5\n";
# test if implicit assign to $_ in while() works
@r = ();
-while (<*/a*.t>) {
- print "# $_\n";
- push @r, $_;
+if ($^O eq 'MacOS') {
+ while (<:*:a*.t>) {
+ print "# $_\n";
+ push @r, $_;
+ }
+} else {
+ while (<*/a*.t>) {
+ print "# $_\n";
+ push @r, $_;
+ }
}
print "not " if @r != $r;
print "ok 6\n";
# test if explicit glob() gets assign magic too
my @s = ();
-while (glob '*/a*.t') {
+my $pat = ($^O eq 'MacOS') ? ':*:a*.t': '*/a*.t';
+while (glob ($pat)) {
print "# $_\n";
push @s, $_;
}