Skip to content

Commit

Permalink
Add tests to exercise panic
Browse files Browse the repository at this point in the history
Adapted from mauke comment in GH #10194:
#10194 (comment)

TODO only the failing test.
  • Loading branch information
jkeenan committed Jul 17, 2024
1 parent d5130c9 commit 2dbb9b3
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion t/re/pat_rt_report.t
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use warnings;
use 5.010;
use Config;

plan tests => 2514; # Update this when adding/deleting tests.
plan tests => 2518; # Update this when adding/deleting tests.

run_tests() unless caller;

Expand Down Expand Up @@ -1168,6 +1168,39 @@ EOP
ok($result == 0);
}

{
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) {
# Dump($_);
{
# Doesn't crash
local $@;
eval { $_ =~ /(.*)/; };
ok(! $@, 'no panic: GH #10194');
}
}
# List context
{
local $@;
eval { () = $line =~ /(.*)/; };
ok(! $@, 'no panic, list context: GH #10194');
}
TODO: {
todo_skip 'GH #10194', 1;
local $@;
eval { () = $str =~ /(.*)/; };
ok(! $@, 'no panic, list context: GH #10194');
}
}

} # End of sub run_tests

1;

0 comments on commit 2dbb9b3

Please sign in to comment.