Permalink
Browse files

Change regexps using { to have { escaped for compatibily with perl >=…

…5.17

Solves gh #872
1 parent 4dd94f4 commit ab8de238fd0586944960cdca0fe4797273056683 @kentfredric committed Dec 15, 2012
@@ -124,12 +124,12 @@ sub format_message {
my $fmt = $self->_log_format();
- $fmt =~ s{
+ $fmt =~ s^
(?:
\%\{(.+?)\}([a-z])|
\%([a-zA-Z])
)
- }{ $1 ? $block_handler->($1, $2) : $char_mapping->($3) }egx;
+ ^ $1 ? $block_handler->($1, $2) : $char_mapping->($3) ^egx;
return $fmt."\n";
}
@@ -102,8 +102,8 @@ if ( (my ($pre, $version, $post)) = ($line =~ /^(\s*)(\S.*\S)(\s*)$/)) {
my $lpost = length $post;
$lpre and _fail("line starts with $lpre blank caracters, but it should not");
$lpost and _fail("line ends with $lpre blank caracters, but it should not");
- like($version, qr/^{{\$NEXT}}$|^\d\.\d{4}(_\d{2} | )\d{2}.\d{2}.\d{4}$/, "changelog line $line_nb: check version failed");
- $version =~ qr/^({{\$NEXT}})$|^\d\.\d{4}(_\d{2} | )\d{2}.\d{2}.\d{4}$/;
+ like($version, qr/^\{\{\$NEXT\}\}$|^\d\.\d{4}(_\d{2} | )\d{2}.\d{2}.\d{4}$/, "changelog line $line_nb: check version failed");
+ $version =~ qr/^(\{\{\$NEXT\}\})$|^\d\.\d{4}(_\d{2} | )\d{2}.\d{2}.\d{4}$/;
# print STDERR " -------> [$1] [$2]\n";
$current_version_is_dev = defined $1 || $2 =~ /^_\d{2}/;
@@ -25,7 +25,7 @@ use Dancer::Template::TemplateToolkit;
is(scalar(@error_lines), 3, "test verbose croak");
like($error_lines[0], qr!^core - template - '/not/a/valid/file' doesn\'t exist or not a regular file at!, "test verbose croak");
like($error_lines[1], qr!^\s*Dancer::Template::TemplateToolkit::render\('Dancer::Template::TemplateToolkit', '/not/a/valid/file'\) called at!, "test verbose croak stack trace");
- like($error_lines[2], qr!^\s*eval {...} called at (?:[.]/)?t/01_config/06_stack_trace.t!, "test verbose croak stack trace");
+ like($error_lines[2], qr!^\s*eval \{...\} called at (?:[.]/)?t/01_config/06_stack_trace.t!, "test verbose croak stack trace");
}
{
@@ -49,5 +49,5 @@ use Dancer::Template::TemplateToolkit;
is(scalar(@error_lines), 3, "test verbose croak");
like($error_lines[0], qr!^core - template - '/not/a/valid/file' doesn\'t exist or not a regular file at!, "test verbose croak");
like($error_lines[1], qr!^\s*Dancer::Template::TemplateToolkit::render\('Dancer::Template::TemplateToolkit', '/not/a/valid/file'\) called at!, "test verbose croak stack trace");
- like($error_lines[2], qr!^\s*eval {...} called at (?:[.]/)?t/01_config/06_stack_trace.t!, "test verbose croak stack trace");
+ like($error_lines[2], qr!^\s*eval \{...\} called at (?:[.]/)?t/01_config/06_stack_trace.t!, "test verbose croak stack trace");
}
@@ -20,7 +20,7 @@ Test::Output::stderr_like(
Test::Output::stderr_like(
sub { Dancer::Logger::warning( { this => 'that' } ) },
- qr/\[\d+\] warn @.+> {'this' => 'that'} in/,
+ qr/\[\d+\] warn @.+> \{'this' => 'that'\} in/,
'Hashref correctly serialized',
);
@@ -32,6 +32,6 @@ Test::Output::stderr_like(
Test::Output::stderr_like(
sub { Dancer::Logger::warning( { b => 1, a => 2, e => 3, d => 4, c => 5}) },
- qr/\[\d+\] warn @.+> {'a' => 2,'b' => 1,'c' => 5,'d' => 4,'e' => 3}/,
+ qr/\[\d+\] warn @.+> \{'a' => 2,'b' => 1,'c' => 5,'d' => 4,'e' => 3\}/,
'Hash keys are sorted okay',
);
@@ -68,7 +68,7 @@ SKIP: {
# with options
$data = { foo => { bar => { baz => [qw/23 42/] } } };
$json = to_json( $data, { pretty => 1 } );
- like $json, qr/"foo" : {/, "data is pretty!";
+ like $json, qr/"foo" : \{/, "data is pretty!";
my $data2 = from_json($json);
is_deeply( $data2, $data, "data is correctly deserialized" );

1 comment on commit ab8de23

@mokko
mokko commented on ab8de23 Apr 3, 2013

I checked first two patches and this PR appears to be merged already; can be closed.

Please sign in to comment.