X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Frun%2Ffresh_perl.t;h=d422bee3c87287c67b9933db8324352273c54dca;hb=1387f30c3a0e2c0d15467578b3cb17d441a9efff;hp=d8cc862ff425d3212dc4ffc8ce77578df46d90d3;hpb=e344bad3baf2bf2e0915ab481c789fd45967284b;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/run/fresh_perl.t b/t/run/fresh_perl.t index d8cc862..d422bee 100644 --- a/t/run/fresh_perl.t +++ b/t/run/fresh_perl.t @@ -35,11 +35,13 @@ foreach my $prog (@prgs) { 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) { @@ -50,7 +52,7 @@ foreach my $prog (@prgs) { $expected =~ s/\n+$//; - fresh_perl_is($prog, $expected, { switches => [$switch] }, $name); + fresh_perl_is($prog, $expected, { switches => [$switch || ''] }, $name); } __END__ @@ -383,7 +385,7 @@ 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 } @@ -510,7 +512,7 @@ else { if ($x == 0) { print "" } else { print $x } } EXPECT -Use of uninitialized value in numeric eq (==) at - line 4. +Use of uninitialized value $x in numeric eq (==) at - line 3. ######## $x = sub {}; foo(); @@ -651,8 +653,9 @@ new_pmop "abcdef"; reset; 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; @@ -824,11 +827,12 @@ EXPECT foo at - line 1. ######## glob() bug Mon, 01 Sep 2003 02:25:41 -0700 <200309010925.h819Pf0X011457@smtp3.ActiveState.com> -lw +BEGIN { + eval 'require Fcntl'; + if ($@) { print qq[./"TEST"\n./"TEST"\n]; exit 0 } # running minitest? +} if ($^O eq 'VMS') { # VMS is not *that* kind of a glob. -print <<__EOF__; -./"TEST" -./"TEST" -__EOF__ +print qq[./"TEST"\n./"TEST"\n]; } else { print glob(q(./"TEST")); use File::Glob; @@ -839,11 +843,12 @@ EXPECT ./"TEST" ######## glob() bug Mon, 01 Sep 2003 02:25:41 -0700 <200309010925.h819Pf0X011457@smtp3.ActiveState.com> -lw +BEGIN { + eval 'require Fcntl'; + if ($@) { print qq[./"TEST"\n./"TEST"\n]; exit 0 } # running minitest? +} if ($^O eq 'VMS') { # VMS is not *that* kind of a glob. -print <<__EOF__; -./"TEST" -./"TEST" -__EOF__ +print qq[./"TEST"\n./"TEST"\n]; } else { use File::Glob; print glob(q(./"TEST")); @@ -853,3 +858,20 @@ print glob(q(./"TEST")); EXPECT ./"TEST" ./"TEST" +######## "Segfault using HTML::Entities", Richard Jolly , 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"; +Encode::_utf8_on($t); +$t =~ s/([^a])//ge; +$@ =~ s/ at .*/ at/; +print $@ +EXPECT +Malformed UTF-8 character (unexpected end of string) in substitution (s///) at