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__
########
eval 'sub bar {print "In bar"}';
########
-system './perl -ne "print if eof" /dev/null' unless $^O eq 'MacOS'
+system './perl -ne "print if eof" /dev/null'
########
chop($file = <DATA>);
########
EXPECT
ok
########
-open(H,$^O eq 'MacOS' ? ':run:fresh_perl.t' : 'run/fresh_perl.t'); # must be in the 't' directory
+open(H,'run/fresh_perl.t'); # must be in the 't' directory
stat(H);
print "ok\n" if (-e _ and -f _ and -r _);
EXPECT
-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;
print join '', @a, "\n";
EXPECT
123456789
-######## [ID 20020104.007] "coredump on dbmclose"
-package Foo;
-eval { require AnyDBM_File }; # not all places have dbm* functions
-if ($@) {
- print "ok\n";
- exit 0;
-}
-package Foo;
-sub new {
- my $proto = shift;
- my $class = ref($proto) || $proto;
- my $self = {};
- bless($self,$class);
- my %LT;
- dbmopen(%LT, "dbmtest", 0666) ||
- die "Can't open dbmtest because of $!\n";
- $self->{'LT'} = \%LT;
- return $self;
-}
-sub DESTROY {
- my $self = shift;
- dbmclose(%{$self->{'LT'}});
- 1 while unlink 'dbmtest';
- 1 while unlink <dbmtest.*>;
- print "ok\n";
-}
-package main;
-$test = Foo->new(); # must be package var
-EXPECT
-ok
######## example from Camel 5, ch. 15, pp.406 (with my)
# SKIP: ord "A" == 193 # EBCDIC
use strict;
######## glob() bug Mon, 01 Sep 2003 02:25:41 -0700 <200309010925.h819Pf0X011457@smtp3.ActiveState.com>
-lw
BEGIN {
+ if ($^O eq 'os390') {
+ require File::Glob;
+ import File::Glob ':glob';
+ }
+}
+BEGIN {
eval 'require Fcntl';
if ($@) { print qq[./"TEST"\n./"TEST"\n]; exit 0 } # running minitest?
}
######## glob() bug Mon, 01 Sep 2003 02:25:41 -0700 <200309010925.h819Pf0X011457@smtp3.ActiveState.com>
-lw
BEGIN {
+ if ($^O eq 'os390') {
+ require File::Glob;
+ import File::Glob ':glob';
+ }
+}
+BEGIN {
eval 'require Fcntl';
if ($@) { print qq[./"TEST"\n./"TEST"\n]; exit 0 } # running minitest?
}
./"TEST"
######## "Segfault using HTML::Entities", Richard Jolly <richardjolly@mac.com>, <A3C7D27E-C9F4-11D8-B294-003065AE00B6@mac.com> in perl-unicode@perl.org
-lw
+# SKIP: use Config; $ENV{PERL_CORE_MINITEST} or " $Config::Config{'extensions'} " !~ m[ Encode ] # Perl configured without Encode module
BEGIN {
eval 'require Encode';
if ($@) { exit 0 } # running minitest?
# Test case cut down by jhi
$SIG{__WARN__} = sub { $@ = shift };
use Encode;
-my $t = "\xE9";
+my $t = ord('A') == 193 ? "\xEA" : "\xE9";
Encode::_utf8_on($t);
$t =~ s/([^a])//ge;
$@ =~ s/ at .*/ at/;
print $@
EXPECT
-Malformed UTF-8 character (unexpected end of string) at
+Malformed UTF-8 character (unexpected end of string) in substitution (s///) at