perl
view release on metacpan or search on metacpan
t/run/todo.t view on Meta::CPAN
# committed the result, run
#
# perl Porting/updateAUTHORS.pl
#
# This will automatically add you (if you weren't there already) to our list
# of contributors. If so, you will need to commit this change by doing
# something like:
#
# commit -a -m'[your name here] is now a Perl 5 author'
#
# Adding tests here helps in two ways. It might show that the bug has already
# been fixed and we just don't know it; or skimming the existing tests here
# might show that there is an existing ticket already open, and the new ticket
# can be marked as duplicate.
BEGIN {
chdir 't' if -d 't';
require './test.pl'; # for fresh_perl_is() etc
set_up_inc('../lib', '.', '../ext/re');
require './charset_tools.pl';
require './loc_tools.pl';
}
use Config;
use strict;
use warnings;
my $switches = "";
my $is_debugging_build = $Config{config_args} =~ /\bDDEBUGGING\b(*nla:=none)/;
our $TODO;
TODO: {
local $::TODO = 'GH 1420';
my $data = <<~"HERE";
AMAZING BUT TRUE ...
There is so much sand in Northern Africa that if it were spread out it
would completely cover the Sahara Desert.
HERE
my $fh = do {
local *FH;
open(FH, '<', \$data);
*FH{IO};
};
0 while <$fh>;
my $lc = $.;
close($fh);
is($lc, 4, 'Correct line count reported from $. when reading from *FH{IO}; GH 1420');
}
TODO: {
local $::TODO = 'GH 2027';
my sub new {
my ($class, $code) = @_;
return bless $code => $class;
}
my @codes;
for my $i (1 .. 2) {
push @codes, new('main', sub {});
}
isnt($codes[0], $codes[1], 'The same subroutine reference is not re-used when blessed; GH 2027');
}
TODO: {
local $::TODO = 'GH 5835';
my $prev_w = $^W;
$^W = 1;
{
local $^W = $^W;
is($^W, '1', 'local $^W assignment to self ok');
}
is($^W, 1, '$^W value prior to localization is restored; GH 5835');
$^W = $prev_w;
}
TODO: {
local $TODO = "[GH 8267]";
"A" =~ /(((?:A))?)+/;
my $first = $2;
"A" =~ /(((A))?)+/;
my $second = $2;
is($first, $second, "[GH 8267]");
}
TODO: {
local $TODO = "[GH 8859]";
fresh_perl_is(<<~'EOF',
my $mul = 2**32; my $a = 104712103; my $b = 50;
my $c = 449735057880383538; # For these values, $mul * $a + $b == $c. Thus $diff should be zero.
my $diff = $c - ($a * $mul + $b);
printf "%.0f %.0f %.0f %.0f", $a, $b, $c, $diff;
#printf "\$c $c %0.f\n", $c;
EOF
"104712103 50 449735057880383538 0", { eval $switches }, "[GH 8859]");
}
TODO: {
local $TODO = "[GH 10194]";
todo_skip 1 if is_miniperl();
fresh_perl_is(<<~'EOF',
use Encode;
use Devel::Peek;
my $line = "\xe2\x90\x0a";
chomp(my $str = "\xe2\x90\x0a");
Encode::_utf8_on($line);
Encode::_utf8_on($str);
for ($line, $str) {
( run in 0.831 second using v1.01-cache-2.11-cpan-a49fcb8fa48 )