diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-09-08 08:41:38 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-09-08 11:27:21 +0200 |
commit | 7b903762ad0ebd5d0459692ad5c081c69a3c0808 (patch) | |
tree | 6e64cf76feca7527bf3a0b2ab962572023e5887e /lib | |
parent | a34ce875bf70f00f7af4a549f8c1ff0f4469f7fb (diff) | |
download | perl-7b903762ad0ebd5d0459692ad5c081c69a3c0808.tar.gz |
Remove code specific to MacOS Classic from core tests
Diffstat (limited to 'lib')
-rw-r--r-- | lib/FindBin.t | 7 | ||||
-rw-r--r-- | lib/blib.t | 23 | ||||
-rw-r--r-- | lib/charnames.t | 30 | ||||
-rw-r--r-- | lib/diagnostics.t | 9 | ||||
-rw-r--r-- | lib/h2xs.t | 17 | ||||
-rw-r--r-- | lib/lib.t | 10 | ||||
-rw-r--r-- | lib/open.t | 1 | ||||
-rw-r--r-- | lib/strict.t | 8 | ||||
-rw-r--r-- | lib/subs.t | 3 |
9 files changed, 16 insertions, 92 deletions
diff --git a/lib/FindBin.t b/lib/FindBin.t index be6f58c3e0..36e142c476 100644 --- a/lib/FindBin.t +++ b/lib/FindBin.t @@ -10,12 +10,7 @@ print "1..2\n"; use FindBin qw($Bin); print "# $Bin\n"; - -if ($^O eq 'MacOS') { - print "not " unless $Bin =~ m,:lib:$,; -} else { - print "not " unless $Bin =~ m,[/.]lib\]?$,; -} +print "not " unless $Bin =~ m,[/.]lib\]?$,; print "ok 1\n"; $0 = "-"; diff --git a/lib/blib.t b/lib/blib.t index a959471cbf..2ad9827d77 100644 --- a/lib/blib.t +++ b/lib/blib.t @@ -29,7 +29,7 @@ if ($Is_VMS) { sub _cleanup { rmdir foreach reverse (@_); - unlink "stderr" unless $^O eq 'MacOS'; + unlink "stderr"; } sub _mkdirs { @@ -41,21 +41,10 @@ sub _mkdirs { BEGIN { - if ($^O eq 'MacOS') - { - $MacPerl::Architecture = $MacPerl::Architecture; # shhhhh - $blib = ":blib:"; - $blib_lib = ":blib:lib:"; - $blib_arch = ":blib:lib:$MacPerl::Architecture:"; - @blib_dirs = ($blib, $blib_lib, $blib_arch); # order - } - else - { - $blib = "blib"; - $blib_arch = "blib/arch"; - $blib_lib = "blib/lib"; - @blib_dirs = ($blib, $blib_arch, $blib_lib); - } + $blib = "blib"; + $blib_arch = "blib/arch"; + $blib_lib = "blib/lib"; + @blib_dirs = ($blib, $blib_arch, $blib_lib); _cleanup( @blib_dirs ); } @@ -82,7 +71,7 @@ if ($Is_VMS_mode) { $blib_arch = 'blib.arch]'; $blib_lib = 'blib.lib]'; } -elsif ($^O ne 'MacOS') +else { $blib_arch = File::Spec->catdir("blib","arch"); $blib_lib = File::Spec->catdir("blib","lib"); diff --git a/lib/charnames.t b/lib/charnames.t index b3e4a461d8..f74453ded7 100644 --- a/lib/charnames.t +++ b/lib/charnames.t @@ -176,28 +176,14 @@ print "ok 24\n"; print "not " unless "\N{NULL}" eq "\c@"; print "ok 25\n"; -if ($^O eq 'MacOS') -{ - print "not " unless "\N{CARRIAGE RETURN (CR)}" eq "\n"; - print "ok 26\n"; - - print "not " unless "\N{CARRIAGE RETURN}" eq "\n"; - print "ok 27\n"; +print "not " unless "\N{LINE FEED (LF)}" eq "\n"; +print "ok 26\n"; - print "not " unless "\N{CR}" eq "\n"; - print "ok 28\n"; -} -else -{ - print "not " unless "\N{LINE FEED (LF)}" eq "\n"; - print "ok 26\n"; +print "not " unless "\N{LINE FEED}" eq "\n"; +print "ok 27\n"; - print "not " unless "\N{LINE FEED}" eq "\n"; - print "ok 27\n"; - - print "not " unless "\N{LF}" eq "\n"; - print "ok 28\n"; -} +print "not " unless "\N{LF}" eq "\n"; +print "ok 28\n"; my $nel = ord("A") == 193 ? qr/^(?:\x15|\x25)$/ : qr/^\x85$/; @@ -302,10 +288,6 @@ for (@prgs) { $res =~ s/\n%[A-Z]+-[SIWEF]-.*$// # clip off DCL status msg if $^O eq "VMS"; $exp =~ s/[\r\n]+$//; - if ($^O eq "MacOS") { - $exp =~ s{(\./)?abc\.pm}{:abc.pm}g; - $exp =~ s{./abc} {:abc}g; - } my $pfx = ($res =~ s/^PREFIX\n//); my $rexp = qr{^$exp}; if ($res =~ s/^SKIPPED\n//) { diff --git a/lib/diagnostics.t b/lib/diagnostics.t index d9855a9fcc..f30f70e073 100644 --- a/lib/diagnostics.t +++ b/lib/diagnostics.t @@ -1,13 +1,8 @@ #!./perl BEGIN { - if ($^O eq 'MacOS') { - chdir '::' if -d '::pod' && -d '::t'; - @INC = ':lib:'; - } else { - chdir '..' if -d '../pod' && -d '../t'; - @INC = 'lib'; - } + chdir '..' if -d '../pod' && -d '../t'; + @INC = 'lib'; } use Test::More tests => 2; diff --git a/lib/h2xs.t b/lib/h2xs.t index 7d037f3951..6ce37ee357 100644 --- a/lib/h2xs.t +++ b/lib/h2xs.t @@ -53,7 +53,6 @@ if ($^O eq 'VMS') { } $Is_VMS_traildot = 0 if $drop_dot && unix_rpt; } -if ($^O eq 'MacOS') { $extracted_program = '::utils:h2xs'; } if (!(-e $extracted_program)) { print "1..0 # Skip: $extracted_program was not built\n"; exit 0; @@ -65,13 +64,6 @@ if (!(-e $extracted_program)) { my $dupe = '2>&1'; # ok on unix, nt, The extra \" are for VMS my $lib = '"-I../lib" "-I../../lib"'; -# The >&1 would create a file named &1 on MPW (STDERR && STDOUT are -# already merged). -if ($^O eq 'MacOS') { - $dupe = ''; - # -x overcomes MPW $Config{startperl} anomaly - $lib = '-x -I::lib: -I:::lib:'; -} # $name should differ from system header file names and must # not already be found in the t/ subdirectory for perl. my $name = 'h2xst'; @@ -189,11 +181,6 @@ while (my ($args, $version, $expectation) = splice @tests, 0, 3) { cmp_ok ($?, "==", 0, "running $prog "); $result = join("",@result); - # accomodate MPW # comment character prependage - if ($^O eq 'MacOS') { - $result =~ s/#\s*//gs; - } - #print "# expectation is >$expectation<\n"; #print "# result is >$result<\n"; # Was the output the list of files that were expected? @@ -203,10 +190,6 @@ while (my ($args, $version, $expectation) = splice @tests, 0, 3) { find (sub {$got{$File::Find::name}++ unless -d $_}, $name); foreach ($expectation =~ /Writing\s+(\S+)/gm) { - if ($^O eq 'MacOS') { - $_ = ':' . join(':',split(/\//,$_)); - $_ =~ s/$name:t:1.t/$name:t\/1.t/; # is this an h2xs bug? - } if ($^O eq 'VMS') { if ($Is_VMS_traildot) { $_ .= '.' unless $_ =~ m/\./; @@ -52,13 +52,6 @@ use lib $Lib_Dir; BEGIN { use_ok('Yup') } BEGIN { - if ($^O eq 'MacOS') { - for ($Lib_Dir, $Arch_Dir) { - tr|/|:|; - $_ .= ":" unless /:$/; - $_ = ":$_" unless /^:/; # we know this path is relative - } - } is( $INC[1], $Lib_Dir, 'lib adding at end of @INC' ); print "# \@INC == @INC\n"; is( $INC[0], $Arch_Dir, ' auto/ dir in front of that' ); @@ -67,9 +60,6 @@ BEGIN { # Yes, %INC uses Unixy filepaths. # Not on Mac OS, it doesn't ... it never has, at least. my $path = join("/",$Lib_Dir, 'Yup.pm'); - if ($^O eq 'MacOS') { - $path = $Lib_Dir . 'Yup.pm'; - } is( $INC{'Yup.pm'}, $path, '%INC set properly' ); is( eval { do 'Yup.pm' }, 42, 'do() works' ); diff --git a/lib/open.t b/lib/open.t index 4ce7371a16..b062ff3a4e 100644 --- a/lib/open.t +++ b/lib/open.t @@ -3,7 +3,6 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; - push @INC, "::lib:$MacPerl::Architecture:" if $^O eq 'MacOS'; require Config; import Config; } diff --git a/lib/strict.t b/lib/strict.t index bfe6b636c5..93264ac70e 100644 --- a/lib/strict.t +++ b/lib/strict.t @@ -16,7 +16,7 @@ my $i = 0 ; my @prgs = () ; -foreach (sort glob($^O eq 'MacOS' ? ":lib:strict:*" : "lib/strict/*")) { +foreach (sort glob("lib/strict/*")) { next if -d || /(~|\.orig|,v)$/; @@ -53,7 +53,6 @@ for (@prgs){ while (@files > 2) { my $filename = shift @files ; my $code = shift @files ; - $code =~ s|\./abc|:abc|g if $^O eq 'MacOS'; push @temps, $filename ; open F, ">$filename" or die "Cannot open $filename: $!\n" ; print F $code ; @@ -61,7 +60,6 @@ for (@prgs){ } shift @files ; $prog = shift @files ; - $prog =~ s|\./abc|:abc|g if $^O eq 'MacOS'; } my $tmpfile = tempfile(); open TEST, ">$tmpfile" or die "Could not open: $!"; @@ -71,8 +69,6 @@ for (@prgs){ `.\\perl -I../lib $switch $tmpfile 2>&1` : $^O eq 'NetWare' ? `perl -I../lib $switch $tmpfile 2>&1` : - $^O eq 'MacOS' ? - `$^X -I::lib -MMac::err=unix $switch $tmpfile` : `$^X $switch $tmpfile 2>&1`; my $status = $?; $results =~ s/\n+$//; @@ -80,8 +76,6 @@ for (@prgs){ $results =~ s/tmp\d+[A-Z][A-Z]?/-/g; $results =~ s/\n%[A-Z]+-[SIWEF]-.*$// if $Is_VMS; # clip off DCL status msg $expected =~ s/\n+$//; - $expected =~ s|(\./)?abc\.pm|:abc.pm|g if $^O eq 'MacOS'; - $expected =~ s|./abc|:abc|g if $^O eq 'MacOS'; my $prefix = ($results =~ s/^PREFIX\n//) ; my $TODO = $prog =~ m/^#\s*TODO:/; if ( $results =~ s/^SKIPPED\n//) { diff --git a/lib/subs.t b/lib/subs.t index b1999b2053..709fcfae02 100644 --- a/lib/subs.t +++ b/lib/subs.t @@ -15,7 +15,6 @@ print "1..", scalar @prgs, "\n"; my $Is_VMS = $^O eq 'VMS'; my $Is_MSWin32 = $^O eq 'MSWin32'; my $Is_NetWare = $^O eq 'NetWare'; -my $Is_MacOS = $^O eq 'MacOS'; my $i = 0 ; for (@prgs){ @@ -52,8 +51,6 @@ for (@prgs){ `.\\perl -I../lib $switch $tmpfile 2>&1` : $Is_NetWare ? `perl -I../lib $switch $tmpfile 2>&1` : - $Is_MacOS ? - `$^X -I::lib -MMac::err=unix $switch $tmpfile` : `./perl $switch $tmpfile 2>&1`; my $status = $?; $results =~ s/\n+$//; |