my($raw_prog, $name) = @$prog;
my $switch;
- if ($raw_prog =~ s/^\s*(-\w.*)//){
+ if ($raw_prog =~ s/^\s*(-\w.*)\n//){
$switch = $1;
}
my($prog,$expected) = split(/\nEXPECT\n/, $raw_prog);
+ $prog .= "\n";
+ $expected = '' unless defined $expected;
if ($prog =~ /^\# SKIP: (.+)/m) {
if (eval $1) {
$expected =~ s/\n+$//;
- fresh_perl_is($prog, $expected, { switches => [$switch] }, $name);
+ fresh_perl_is($prog, $expected, { switches => [$switch || ''] }, $name);
}
__END__
-w
sub testme { my $a = "test"; { local $a = "new test"; print $a }}
EXPECT
-Can't localize lexical variable $a at - line 2.
+Can't localize lexical variable $a at - line 1.
########
package X;
sub ascalar { my $r; bless \$r }
if ($x == 0) { print "" } else { print $x }
}
EXPECT
-Use of uninitialized value $x in numeric eq (==) at - line 4.
+Use of uninitialized value $x in numeric eq (==) at - line 3.
########
$x = sub {};
foo();
close STDERR; die;
EXPECT
########
+# core dump in 20000716.007
-w
-"x" =~ /(\G?x)?/; # core dump in 20000716.007
+"x" =~ /(\G?x)?/;
########
# Bug 20010515.004
my @h = 1 .. 10;