Skip to content

Commit

Permalink
rewrite a regex in lib/DB.t using \Q
Browse files Browse the repository at this point in the history
The regexp for the 'eval BLOCK' test should match explicit '...'.
So avoid the \{ issue and put \Q before all the punctuation.
  • Loading branch information
Robin Barker authored and nwc10 committed Jul 20, 2012
1 parent fc616f2 commit 7150f91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/DB.t
Expand Up @@ -126,7 +126,7 @@ is( DB::_clientname('bar'), undef,
my @ret = eval { DB->backtrace() };
like( $ret[0], qr/file.+\Q$0\E/, 'DB::backtrace() should report current file');
like( $ret[0], qr/line $line/, '... should report calling line number' );
like( $ret[0], qr/eval {...}/, '... should catch eval BLOCK' );
like( $ret[0], qr/eval\Q {...}/, '... should catch eval BLOCK' );

@ret = eval "one(2)";
is( scalar @ret, 1, '... should report from provided stack frame number' );
Expand Down

0 comments on commit 7150f91

Please sign in to comment.