summaryrefslogtreecommitdiff
path: root/t/op/misc.t
diff options
context:
space:
mode:
Diffstat (limited to 't/op/misc.t')
-rwxr-xr-xt/op/misc.t13
1 files changed, 10 insertions, 3 deletions
diff --git a/t/op/misc.t b/t/op/misc.t
index 0f251ea354..02d32bd5c5 100755
--- a/t/op/misc.t
+++ b/t/op/misc.t
@@ -14,17 +14,24 @@ $tmpfile = "misctmp000";
1 while -f ++$tmpfile;
END { unlink $tmpfile if $tmpfile; }
+$CAT = (($^O eq 'MSWin32') ? '.\perl -e "print <>"' : 'cat');
+
for (@prgs){
my $switch;
if (s/^\s*-\w+//){
$switch = $&;
}
my($prog,$expected) = split(/\nEXPECT\n/, $_);
- open TEST, "| sh -c './perl $switch' >$tmpfile 2>&1";
+ if ($^O eq 'MSWin32') {
+ open TEST, "| .\\perl -I../lib $switch >$tmpfile 2>&1";
+ }
+ else {
+ open TEST, "| sh -c './perl $switch' >$tmpfile 2>&1";
+ }
print TEST $prog, "\n";
close TEST;
$status = $?;
- $results = `cat $tmpfile`;
+ $results = `$CAT $tmpfile`;
$results =~ s/\n+$//;
$expected =~ s/\n+$//;
if ( $results ne $expected){
@@ -74,7 +81,7 @@ EXPECT
########
eval {sub bar {print "In bar";}}
########
-system "./perl -ne 'print if eof' /dev/null"
+system './perl -ne "print if eof" /dev/null'
########
chop($file = <>);
########