diff options
Diffstat (limited to 't/op')
-rwxr-xr-x | t/op/magic.t | 2 | ||||
-rwxr-xr-x | t/op/misc.t | 3 | ||||
-rwxr-xr-x | t/op/mkdir.t | 2 | ||||
-rwxr-xr-x | t/op/runlevel.t | 5 | ||||
-rwxr-xr-x | t/op/stat.t | 18 | ||||
-rwxr-xr-x | t/op/write.t | 8 |
6 files changed, 24 insertions, 14 deletions
diff --git a/t/op/magic.t b/t/op/magic.t index fa19716c14..b338d9600a 100755 --- a/t/op/magic.t +++ b/t/op/magic.t @@ -25,7 +25,7 @@ $PERL = ($Is_MSWin32 ? '.\perl' : './perl'); print "1..28\n"; eval '$ENV{"foo"} = "hi there";'; # check that ENV is inited inside eval -if ($Is_MSWin32) { ok 1, `set foo` eq "foo=hi there\n"; } +if ($Is_MSWin32) { ok 1, `cmd /x /c set foo` eq "foo=hi there\n"; } else { ok 1, `echo \$foo` eq "hi there\n"; } unlink 'ajslkdfpqjsjfk'; diff --git a/t/op/misc.t b/t/op/misc.t index 02d32bd5c5..1a5afe544a 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -95,7 +95,8 @@ EXPECT ######## %@x=0; EXPECT -Can't coerce HASH to string in repeat at - line 1. +Can't modify hash deref in repeat at - line 1, near "0;" +Execution of - aborted due to compilation errors. ######## $_="foo"; printf(STDOUT "%s\n", $_); diff --git a/t/op/mkdir.t b/t/op/mkdir.t index 7db5ec91e4..1ffeaa1d66 100755 --- a/t/op/mkdir.t +++ b/t/op/mkdir.t @@ -4,7 +4,7 @@ print "1..7\n"; -`rm -rf blurfl`; +$^O eq 'MSWin32' ? `cmd /x /c del /s /q blurfl` : `rm -rf blurfl`; print (mkdir('blurfl',0777) ? "ok 1\n" : "not ok 1\n"); print (mkdir('blurfl',0777) ? "not ok 2\n" : "ok 2\n"); diff --git a/t/op/runlevel.t b/t/op/runlevel.t index 2fc2174596..336b164f5d 100755 --- a/t/op/runlevel.t +++ b/t/op/runlevel.t @@ -17,6 +17,7 @@ chdir 't' if -d 't'; @INC = "../lib"; $Is_VMS = $^O eq 'VMS'; +$Is_MSWin32 = $^O eq 'MSWin32'; $ENV{PERL5LIB} = "../lib" unless $Is_VMS; $|=1; @@ -40,7 +41,9 @@ for (@prgs){ close TEST; my $results = $Is_VMS ? `MCR $^X "-I[-.lib]" $switch $tmpfile` : - `sh -c './perl $switch $tmpfile' 2>&1`; + $Is_MSWin32 ? + `.\\perl -I../lib $switch $tmpfile 2>&1` : + `sh -c './perl $switch $tmpfile' 2>&1`; my $status = $?; $results =~ s/\n+$//; # allow expected output to be written as if $prog is on STDIN diff --git a/t/op/stat.t b/t/op/stat.t index d7271522c2..0713007db5 100755 --- a/t/op/stat.t +++ b/t/op/stat.t @@ -34,7 +34,10 @@ close(FOO); sleep 2; -`rm -f Op.stat.tmp2; ln Op.stat.tmp Op.stat.tmp2; chmod 644 Op.stat.tmp`; +if ($Is_MSWin32) { unlink "Op.stat.tmp2" } +else { + `rm -f Op.stat.tmp2;ln Op.stat.tmp Op.stat.tmp2; chmod 644 Op.stat.tmp`; +} ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime, $blksize,$blocks) = stat('Op.stat.tmp'); @@ -52,19 +55,20 @@ else { } print "#4 :$mtime: != :$ctime:\n"; -`rm -f Op.stat.tmp`; -`touch Op.stat.tmp`; +unlink "Op.stat.tmp"; +if ($Is_MSWin32) { open F, '>Op.stat.tmp' and close F } +else { `touch Op.stat.tmp` } if (-z 'Op.stat.tmp') {print "ok 5\n";} else {print "not ok 5\n";} if (! -s 'Op.stat.tmp') {print "ok 6\n";} else {print "not ok 6\n";} -`echo hi >Op.stat.tmp`; +$Is_MSWin32 ? `cmd /c echo hi > Op.stat.tmp` : `echo hi >Op.stat.tmp`; if (! -z 'Op.stat.tmp') {print "ok 7\n";} else {print "not ok 7\n";} if (-s 'Op.stat.tmp') {print "ok 8\n";} else {print "not ok 8\n";} unlink 'Op.stat.tmp'; $olduid = $>; # can't test -r if uid == 0 -`echo hi >Op.stat.tmp`; +$Is_MSWin32 ? `cmd /c echo hi > Op.stat.tmp` : `echo hi >Op.stat.tmp`; chmod 0,'Op.stat.tmp'; eval '$> = 1;'; # so switch uid (may not be implemented) if (!$> || ! -r 'Op.stat.tmp') {print "ok 9\n";} else {print "not ok 9\n";} @@ -98,7 +102,7 @@ else { if (-o 'Op.stat.tmp') {print "ok 26\n";} else {print "not ok 26\n";} if (-e 'Op.stat.tmp') {print "ok 27\n";} else {print "not ok 27\n";} -`rm -f Op.stat.tmp Op.stat.tmp2`; +unlink 'Op.stat.tmp', 'Op.stat.tmp2'; if (! -e 'Op.stat.tmp') {print "ok 28\n";} else {print "not ok 28\n";} if ($Is_MSWin32) @@ -169,7 +173,7 @@ else { } if (! -t tty) {print "ok 38\n";} else {print "not ok 38\n";} open(null,"/dev/null"); -if (! -t null || -e '/xenix' || -e '/MachTen') +if (! -t null || -e '/xenix' || -e '/MachTen' || $Is_MSWin32) {print "ok 39\n";} else {print "not ok 39\n";} close(null); if (-t) {print "ok 40\n";} else {print "not ok 40\n";} diff --git a/t/op/write.t b/t/op/write.t index 46ec8130b9..705fa7977b 100755 --- a/t/op/write.t +++ b/t/op/write.t @@ -4,6 +4,8 @@ print "1..5\n"; +my $CAT = ($^O eq 'MSWin32') ? 'type' : 'cat'; + format OUT = the quick brown @<< $fox @@ -42,7 +44,7 @@ the course of huma... now is the time for all good men to come to\n"; -if (`cat Op_write.tmp` eq $right) +if (`$CAT Op_write.tmp` eq $right) { print "ok 1\n"; unlink 'Op_write.tmp'; } else { print "not ok 1\n"; } @@ -84,7 +86,7 @@ becomes necessary now is the time for all good men to come to\n"; -if (`cat Op_write.tmp` eq $right) +if (`$CAT Op_write.tmp` eq $right) { print "ok 2\n"; unlink 'Op_write.tmp'; } else { print "not ok 2\n"; } @@ -128,7 +130,7 @@ becomes necessary now is the time for all good men to come to\n"; -if (`cat Op_write.tmp` eq $right) +if (`$CAT Op_write.tmp` eq $right) { print "ok 3\n"; unlink 'Op_write.tmp'; } else { print "not ok 3\n"; } |