PERFORCE change 11202 for review
[email protected] (Chris Nandor) Sat, 7 Jul 2001 21:04:20 -0400
| Newsgroups | perl.perl5.changes.mac |
|---|---|
| Message-ID | <p05100319b76d620b2f14@[10.0.1.177]> |
Change 11202 by pudge@pudge-mobile on 2001/07/07 23:38:36
Some more test portability fixes.
Affected files ...
... //depot/maint-5.6/macperl/t/lib/filecopy.t#2 edit
... //depot/maint-5.6/macperl/t/pragma/warn/pp_sys#3 edit
Differences ...
==== //depot/maint-5.6/macperl/t/lib/filecopy.t#2 (xtext) ====
Index: perl/t/lib/filecopy.t
--- perl/t/lib/filecopy.t.~1~ Sat Jul 7 17:45:05 2001
+++ perl/t/lib/filecopy.t Sat Jul 7 17:45:05 2001
@@ -3,20 +3,19 @@
BEGIN {
chdir 't' if -d 't';
@INC = '../lib';
+ push @INC, "::lib:$MacPerl::Architecture" if $^O eq 'MacOS';
}
$| = 1;
my @pass = (0,1);
-my $tests = 11;
+my $tests = $^O eq 'MacOS' ? 14 : 11;
printf "1..%d\n", $tests * scalar(@pass);
use File::Copy;
for my $pass (@pass) {
- require File::Copy;
-
my $loopconst = $pass*$tests;
# First we create a file
@@ -84,26 +83,65 @@
print "# foo=`$foo'\nnot " unless $foo eq sprintf "ok %d\n", 3+$loopconst;
printf "ok %d\n", 9+$loopconst;
- copy "file-$$", "lib";
- open(R, "lib/file-$$") or die; $foo = <R>; close(R);
- print "not " unless $foo eq sprintf "ok %d\n", 3+$loopconst;
- printf "ok %d\n", 10+$loopconst;
- unlink "lib/file-$$" or die "unlink: $!";
+ if ($^O eq 'MacOS') {
+
+ copy "file-$$", "lib";
+ open(R, ":lib:file-$$") or die; $foo = <R>; close(R);
+ print "not " unless $foo eq sprintf "ok %d\n", 3+$loopconst;
+ printf "ok %d\n", 10+$loopconst;
+ unlink ":lib:file-$$" or die "unlink: $!";
+
+ copy "file-$$", ":lib";
+ open(R, ":lib:file-$$") or die; $foo = <R>; close(R);
+ print "not " unless $foo eq sprintf "ok %d\n", 3+$loopconst;
+ printf "ok %d\n", 11+$loopconst;
+ unlink ":lib:file-$$" or die "unlink: $!";
+
+ copy "file-$$", ":lib:";
+ open(R, ":lib:file-$$") or die; $foo = <R>; close(R);
+ print "not " unless $foo eq sprintf "ok %d\n", 3+$loopconst;
+ printf "ok %d\n", 12+$loopconst;
+ unlink ":lib:file-$$" or die "unlink: $!";
+
+ unless (-e 'lib:') { # make sure there's no volume called 'lib'
+ undef $@;
+ eval { (copy "file-$$", "lib:") || die "'lib:' is not a volume name"; };
+ print "# Died: $@";
+ print "not " unless ( $@ =~ m|'lib:' is not a volume name| );
+ }
+ printf "ok %d\n", 13+$loopconst;
- move "file-$$", "lib";
- open(R, "lib/file-$$") or die "open lib/file-$$: $!"; $foo = <R>; close(R);
- print "not " unless $foo eq sprintf("ok %d\n", 3+$loopconst)
- and not -e "file-$$";;
- printf "ok %d\n", 11+$loopconst;
- unlink "lib/file-$$" or die "unlink: $!";
+ move "file-$$", ":lib:";
+ open(R, ":lib:file-$$") or die "open :lib:file-$$: $!"; $foo = <R>; close(R);
+ print "not " unless $foo eq sprintf("ok %d\n", 3+$loopconst)
+ and not -e "file-$$";;
+ printf "ok %d\n", 14+$loopconst;
+ unlink ":lib:file-$$" or die "unlink: $!";
+
+ } else {
+
+ copy "file-$$", "lib";
+ open(R, "lib/file-$$") or die; $foo = <R>; close(R);
+ print "not " unless $foo eq sprintf "ok %d\n", 3+$loopconst;
+ printf "ok %d\n", 10+$loopconst;
+ unlink "lib/file-$$" or die "unlink: $!";
- # warn sprintf "INC->".$INC{"File/Copy.pm"};
- delete $INC{"File/Copy.pm"};
-
+ move "file-$$", "lib";
+ open(R, "lib/file-$$") or die "open lib/file-$$: $!"; $foo = <R>; close(R);
+ print "not " unless $foo eq sprintf("ok %d\n", 3+$loopconst)
+ and not -e "file-$$";;
+ printf "ok %d\n", 11+$loopconst;
+ unlink "lib/file-$$" or die "unlink: $!";
+
+ }
}
END {
1 while unlink "file-$$";
- 1 while unlink "lib/file-$$";
+ if ($^O eq 'MacOS') {
+ 1 while unlink ":lib:file-$$";
+ } else {
+ 1 while unlink "lib/file-$$";
+ }
}
==== //depot/maint-5.6/macperl/t/pragma/warn/pp_sys#3 (text) ====
Index: perl/t/pragma/warn/pp_sys
--- perl/t/pragma/warn/pp_sys.~1~ Sat Jul 7 17:45:05 2001
+++ perl/t/pragma/warn/pp_sys Sat Jul 7 17:45:05 2001
@@ -141,7 +141,7 @@
.
$= = 1 ;
$- =1 ;
-open STDOUT, ">".($^O eq 'VMS'? 'NL:' : '/dev/null') ;
+open STDOUT, ">".($^O eq 'VMS' ? 'NL:' : $^O eq 'MacOS' ? 'Dev:Null' : '/dev/null') ;
write ;
no warnings 'io' ;
write ;
End of Patch.