B-C
view release on metacpan or search on metacpan
t/issue238.t view on Meta::CPAN
use strict;
BEGIN {
unshift @INC, 't';
require TestBC;
}
use Test::More tests => 4;
# 5.10 fixed with 1.48
my $todo = ""; # ($] =~ /^5\.010/) ? "TODO " : "";
ctestok(1,'C,-O3','ccode238i',<<'EOF',$todo.'#238 format f::STDOUT');
sub f ($);
sub f ($) {
my $test = $_[0];
write;
format STDOUT =
ok @<<<<<<<
$test
.
}
f('');
EOF
t/issue251.t view on Meta::CPAN
ctestok(1,'C,-O3',$name,<<'EOF', $todo.'#251 simple predeclaration');
sub f;$e=exists &f;$d=defined &f;print "ok" if "-$e-$d-" eq "-1--";
EOF
ctestok(2,'C,-O3',$name,<<'EOF', ($] >= 5.018 ? "TODO 5.18 " : "").$todo.'#251 lvalue predeclaration');
sub f :lvalue;$e=exists &f;$d=defined &f;print "ok" if "-$e-$d-" eq "-1--";
EOF
ctestok(3,'C,-O3',$name,<<'EOF', $todo.'#251 empty proto predeclaration');
sub f ();$e=exists &f;$d=defined &f;print "ok" if "-$e-$d-" eq "-1--";
EOF
ctestok(4,'C,-O3',$name,<<'EOF', $todo.'#251 proto predeclaration');
sub f ($);$e=exists &f;$d=defined &f;print "ok" if "-$e-$d-" eq "-1--";
EOF
ctestok(5,'C,-O3',$name,<<'EOF', '#251 regular cv definition');
sub f{1};$e=exists &f;$d=defined &f;print "ok" if "-$e-$d-" eq "-1-1-";
EOF
# similar but not same as test 1
# passes now threaded >= 5.8.9
my $todo6 = ($] < 5.008009 or !$Config{useithreads}) ? "TODO " : "";
ctestok(6,'C,-O3','ccode290i',<<'EOF', $todo6.'#290 empty sub exists && not defined');
tests[234]='$c = 0; for ("-3" .. "0") { $c++ } ; print "$c"'
result[234]='4'
# t/testc.sh -O3 -Dp,-UCarp,-v 235
tests[235]='BEGIN{$INC{"Carp.pm"}="/dev/null"} $d = pack("U*", 0xe3, 0x81, 0xAF); { use bytes; $ol = bytes::length($d) } print $ol'
result[235]='6'
# -O3
tests[236]='sub t { if ($_[0] == $_[1]) { print "ok\n"; } else { print "not ok - $_[0] == $_[1]\n"; } } t(-1.2, " -1.2");'
tests[237]='print "\000\000\000\000_"'
result[237]='_'
tests[238]='sub f ($);
sub f ($) {
my $test = $_[0];
write;
format STDOUT =
ok @<<<<<<<
$test
.
}
f("");
'
tests[2381]='sub is { $_[0] eq $_[1] and print "ok\n"}
t/testcc.sh view on Meta::CPAN
tests[234]='$c = 0; for ("-3" .. "0") { $c++ } ; print "$c"'
result[234]='4'
# t/testc.sh -O3 -Dp,-UCarp,-v 235
tests[235]='BEGIN{$INC{"Carp.pm"}="/dev/null"} $d = pack("U*", 0xe3, 0x81, 0xAF); { use bytes; $ol = bytes::length($d) } print $ol'
result[235]='6'
# -O3
tests[236]='sub t { if ($_[0] == $_[1]) { print "ok\n"; } else { print "not ok - $_[0] == $_[1]\n"; } } t(-1.2, " -1.2");'
tests[237]='print "\000\000\000\000_"'
result[237]='_'
tests[238]='sub f ($);
sub f ($) {
my $test = $_[0];
write;
format STDOUT =
ok @<<<<<<<
$test
.
}
f("");
'
tests[2381]='sub is { $_[0] eq $_[1] and print "ok\n"}
t/testplc.sh view on Meta::CPAN
tests[234]='$c = 0; for ("-3" .. "0") { $c++ } ; print "$c"'
result[234]='4'
# t/testc.sh -O3 -Dp,-UCarp,-v 235
tests[235]='BEGIN{$INC{"Carp.pm"}="/dev/null"} $d = pack("U*", 0xe3, 0x81, 0xAF); { use bytes; $ol = bytes::length($d) } print $ol'
result[235]='6'
# -O3
tests[236]='sub t { if ($_[0] == $_[1]) { print "ok\n"; } else { print "not ok - $_[0] == $_[1]\n"; } } t(-1.2, " -1.2");'
tests[237]='print "\000\000\000\000_"'
result[237]='_'
tests[238]='sub f ($);
sub f ($) {
my $test = $_[0];
write;
format STDOUT =
ok @<<<<<<<
$test
.
}
f("");
'
tests[239]='my $x="1";
( run in 3.170 seconds using v1.01-cache-2.11-cpan-13bb782fe5a )