Skip Menu |

This queue is for tickets about the Test-Expect CPAN distribution.

Report information
The Basics
Id: 81987
Status: resolved
Priority: 0/
Queue: Test-Expect

People
Owner: Nobody in particular
Requestors: trs [...] bestpractical.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.31
Fixed in: (no value)



Subject: [PATCH] Escape sent string when used in regex
Otherwise metacharacters in the sent string interfere with the match and may lead to an invalid regex pattern. --- a/Test/Expect.pm 2012-12-14 13:57:05.000000000 -0800 +++ b/Test/Expect.pm 2012-12-14 13:57:25.000000000 -0800 @@ -56,7 +56,7 @@ sub before { my $before = $expect->before; $before =~ s/\r//g; - $before =~ s/^$sent// if $sent; + $before =~ s/^\Q$sent\E// if $sent; $before =~ s/^\n+//; $before =~ s/\n+$//; return $before;
Fixed in 0.32. - Alex