B-C
view release on metacpan or search on metacpan
t/testplc.sh view on Meta::CPAN
tests[331]='use 5.010; use charnames ":full"; my $char = q/\N{LATIN CAPITAL LETTER A WITH MACRON}/; my $a = eval qq ["$char"]; print length($a) == 1 ? "ok\n" : "$a\n".length($a)."\n"'
tests[332]='#TODO re-eval no_modify, probably WONTFIX
use re "eval"; our ( $x, $y, $z ) = 1..3; $x =~ qr/$x(?{ $y = $z++ })/; undef $@; print "ok\n"'
tests[333]='use encoding "utf8";
my @hiragana = map {chr} ord("ã")..ord("ã"); my @katakana = map {chr} ord("ã¡")..ord("ã³"); my $hiragana = join(q{} => @hiragana); my $katakana = join(q{} => @katakana); my %h2k; @h2k{@hiragana} = @katakana; $str = $hiragana; $str =~ s/([ã-...
tests[338]='use utf8; my $l = "ñ"; my $re = qr/ñ/; print $l =~ $re ? qq{ok\n} : length($l)."\n".ord($l)."\n";'
tests[340]='eval q/use Net::DNS/; my $new = "IO::Socket::INET6"->can("new") or die "die at new"; my $inet = $new->("IO::Socket::INET6", LocalAddr => q/localhost/, Proto => "udp", LocalPort => undef); print q(ok) if ref($inet) eq "IO::Socket::INET6";'
# used to fail in the inc-i340 branches CORE/base/lex.t 54
tests[3401]='sub foo::::::bar { print "ok\n"; } foo::::::bar;'
# wontfix on -O3: static string *end for "main::bar"
tests[345]='eval q/use Sub::Name; 1/ or die "no Sub::Name"; subname("main::bar", sub { 42 } ); print "ok\n";'
# those work fine:
tests[3451]='eval q/use Sub::Name; 1/ or die "no Sub::Name"; subname("bar", sub { 42 } ); print "ok\n";'
tests[3452]='eval q/use Sub::Name; 1/ or die "no Sub::Name"; $bar="main::bar"; subname($bar, sub { 42 } ); print "ok\n";'
tests[348]='package Foo::Bar; sub baz { 1 }
package Foo; sub new { bless {}, shift } sub method { print "ok\n"; }
package main; Foo::Bar::baz();
my $foo = sub {
Foo->new
}->();
$foo->method;'
tests[350]='package Foo::Moose; use Moose; has bar => (is => "rw", isa => "Int");
package main; my $moose = Foo::Moose->new; print "ok" if 32 == $moose->bar(32);'
tests[368]='use EV; print q(ok)'
tests[369]='
use EV;
use Coro;
use Coro::Timer;
my @a;
push @a, async {
while() {
warn $c++;
Coro::Timer::sleep 1;
};
};
push @a, async {
while() {
warn $d++;
Coro::Timer::sleep 0.5;
};
};
schedule;
print q(ok)'
tests[371]='package foo;use Moose;
has "x" => (isa => "Int", is => "rw", required => 1);
has "y" => (isa => "Int", is => "rw", required => 1);
sub clear { my $self = shift; $self->x(0); $self->y(0); }
__PACKAGE__->meta->make_immutable;
package main;
my $f = foo->new( x => 5, y => 6);
print $f->x . "\n";'
result[371]='5'
if [[ $v518 -gt 0 ]]; then
tests[372]='use utf8; require mro; my $f_gen = mro::get_pkg_gen("á"); undef %á::; mro::get_pkg_gen("á"); delete $::{"á::"}; print "ok";'
result[372]='ok'
fi
tests[2050]='use utf8;package í
Å£::á´¼; sub á´¼_or_Ḡ{ "ok" } print á´¼_or_á¸;'
result[2050]='ok'
tests[2051]='use utf8;package ÆÆÆÆ; sub ÆK { "ok" } package ƦƦƦƦ; use base "ÆÆÆÆ"; my $x = bless {}, "ƦƦƦƦ"; print $x->ÆK();'
result[2051]='ok'
tests[404]='use FCGI;sub test {my $s=" ";$s =~ s/ //g;print "ok $s\n";}test();'
result[404]='ok '
init
while getopts "qsScohv" opt
do
if [ "$opt" = "q" ]; then
Q=1
OCMD="$QOCMD"
qq="-qq,"
if [ "$VERS" = "5.6.2" ]; then QOCMD=$OCMD; qq=""; fi
fi
if [ "$opt" = "v" ]; then
Q=
QOCMD="$OCMD"
qq=""
fi
if [ "$opt" = "s" ]; then SKIP=1; fi
if [ "$opt" = "o" ]; then Mblib=" "; SKIP=1; SKI=1; init; fi
if [ "$opt" = "S" ]; then SKIP=1; SKI=1; fi
if [ "$opt" = "c" ]; then CONT=1; shift; fi
if [ "$opt" = "h" ]; then help; exit; fi
done
if [ -z "$Q" ]; then
make
else
make -s >/dev/null
fi
# need to shift the options
while [ -n "$1" -a "${1:0:1}" = "-" ]; do shift; done
if [ -n "$1" ]; then
while [ -n "$1" ]; do
btest $1
shift
done
else
for b in $(seq $ntests); do
btest $b
done
fi
# 5.8: all PASS
# 5.10: FAIL: 2-5, 7, 11, 15. With -D 9-12 fail also.
# 5.11: FAIL: 2-5, 7, 11, 15-16 (all segfaulting in REGEX). With -D 9-12 fail also.
# 5.11d: WRONG 4, FAIL: 9-11, 15-16
# 5.11d linux: WRONG 4, FAIL: 11, 16
#only if ByteLoader installed in @INC
if false; then
echo ${OCMD}-H,-obytecode2.plc bytecode2.pl
${OCMD}-H,-obytecode2.plc bytecode2.pl
chmod +x bytecode2.plc
echo ./bytecode2.plc
./bytecode2.plc
fi
# package pmc
if false; then
( run in 0.824 second using v1.01-cache-2.11-cpan-788537b7465 )