54 lines
2.2 KiB
Diff
54 lines
2.2 KiB
Diff
|
Description: Adjust extended regexp to perl 5.14
|
||
|
Cf. http://search.cpan.org/~jesse/perl-5.14.0/pod/perldelta.pod#%28?^...%29_construct_signifies_default_modifiers
|
||
|
Origin: vendor
|
||
|
Bug: https://rt.cpan.org/Ticket/Display.html?id=72449
|
||
|
Bug-Debian: http://bugs.debian.org/636522
|
||
|
Forwarded: https://rt.cpan.org/Ticket/Display.html?id=72449
|
||
|
Author: gregor herrmann <gregoa@debian.org>
|
||
|
Reviewed-by: gregor herrmann <gregoa@debian.org>
|
||
|
Last-Update: 2011-11-15
|
||
|
|
||
|
--- a/t/10_asserts.t
|
||
|
+++ b/t/10_asserts.t
|
||
|
@@ -201,10 +201,17 @@
|
||
|
# assertExceptionMatches { 1 } 'any'
|
||
|
eval { assertExceptionMatches {1} qr{any} };
|
||
|
die "assertExceptionMatches unexpectedly succeeded" unless $@;
|
||
|
- die "Unexpected error message for assertExceptionMatches {1} qr{any}: $@ ",
|
||
|
- "(expected 'Expected an exception which matched /(?-xism:any)/, but none ",
|
||
|
- "was raised.')"
|
||
|
- unless "$@" =~ m{Expected an exception which matched \Q/(?-xism:any)/\E, but none was raised\.};
|
||
|
+ if ( $] >= 5.014 ) {
|
||
|
+ die "Unexpected error message for assertExceptionMatches {1} qr{any}: $@ ",
|
||
|
+ "(expected 'Expected an exception which matched /(?^:any)/, but none ",
|
||
|
+ "was raised.')"
|
||
|
+ unless "$@" =~ m{Expected an exception which matched \Q/(?^:any)/\E, but none was raised\.};
|
||
|
+ } else {
|
||
|
+ die "Unexpected error message for assertExceptionMatches {1} qr{any}: $@ ",
|
||
|
+ "(expected 'Expected an exception which matched /(?-xism:any)/, but none ",
|
||
|
+ "was raised.')"
|
||
|
+ unless "$@" =~ m{Expected an exception which matched \Q/(?-xism:any)/\E, but none was raised\.};
|
||
|
+ }
|
||
|
|
||
|
# assertExceptionMatches { 1 } 'any', $msg
|
||
|
eval { assertExceptionMatches {1} 'any', "Ack! No exception?"; };
|
||
|
@@ -307,9 +314,15 @@
|
||
|
undef $res;
|
||
|
|
||
|
# assertMatches( qr{\s+}, 1 )
|
||
|
- assertExceptionMatches {
|
||
|
- $res = assertMatches( qr{\s+}, 1 )
|
||
|
- } qr{Tested value '1' did not match wanted regex '\Q(?-xism:\s+)\E};
|
||
|
+ if ( $] >= 5.014 ) {
|
||
|
+ assertExceptionMatches {
|
||
|
+ $res = assertMatches( qr{\s+}, 1 )
|
||
|
+ } qr{Tested value '1' did not match wanted regex '\Q(?^:\s+)\E};
|
||
|
+ } else {
|
||
|
+ assertExceptionMatches {
|
||
|
+ $res = assertMatches( qr{\s+}, 1 )
|
||
|
+ } qr{Tested value '1' did not match wanted regex '\Q(?-xism:\s+)\E};
|
||
|
+ }
|
||
|
assertNot( $res );
|
||
|
undef $res;
|
||
|
},
|