summaryrefslogtreecommitdiff
path: root/dist/Carp
diff options
context:
space:
mode:
authorRicardo Signes <rjbs@cpan.org>2015-03-14 20:44:07 -0400
committerRicardo Signes <rjbs@cpan.org>2015-03-14 20:44:07 -0400
commitf93be873a3e67da603800e8e3151f63835650f02 (patch)
treecbaf3da74c6accf19c412f24587c9bf6b1e931a0 /dist/Carp
parent9bf16f4439f7dc132f2bc90ce5bf40bf0f83ddab (diff)
downloadperl-f93be873a3e67da603800e8e3151f63835650f02.tar.gz
Carp: skip some tests of "$qr" on older perls
On perls v5.9.5 to v5.17.0 inclusive, there's a Latin-1/utf8 length bug and sometimes a character is dropped from the end of the regexp's stringification. On earlier perls, there is an error related to invalid character sequences. Rather than carefully tease these apart, we'll skip the tests. Thanks to Zefram for helping to identify the version range.
Diffstat (limited to 'dist/Carp')
-rw-r--r--dist/Carp/t/arg_regexp.t33
1 files changed, 25 insertions, 8 deletions
diff --git a/dist/Carp/t/arg_regexp.t b/dist/Carp/t/arg_regexp.t
index a913b8c321..1575b291ab 100644
--- a/dist/Carp/t/arg_regexp.t
+++ b/dist/Carp/t/arg_regexp.t
@@ -43,8 +43,14 @@ like lm(qr/a\x{666}/), qr/main::lm\(qr\(a\\x\{666\}\)u?\)/;
like lm(rx("a\x{666}")), qr/main::lm\(qr\(a${x666_rx}\)u?\)/;
like lm(qr/L${chr_e9}on/), qr/main::lm\(qr\(L\\x\{?${e9}\}?on\)u?\)/;
like lm(rx("L${chr_e9}on")), qr/main::lm\(qr\(L${xe9_rx}on\)u?\)/;
-like lm(qr/L${chr_e9}on \x{2603} !/), qr/main::lm\(qr\(L\\x\{?${e9}\}?on \\x\{2603\} !\)u?\)/;
-like lm(rx("L${chr_e9}on \x{2603} !")), qr/main::lm\(qr\(L${xe9_rx}on ${x2603_rx} !\)u?\)/;
+
+
+SKIP: {
+ skip "wide-character-related bug in pre-5.18 perls", 2 if $] lt 5.017_001;
+
+ like lm(qr/L${chr_e9}on \x{2603} !/), qr/main::lm\(qr\(L\\x\{?${e9}\}?on \\x\{2603\} !\)u?\)/;
+ like lm(rx("L${chr_e9}on \x{2603} !")), qr/main::lm\(qr\(L${xe9_rx}on ${x2603_rx} !\)u?\)/;
+}
$Carp::MaxArgLen = 5;
foreach my $arg ("foo bar baz", "foo bar ba", "foo bar b", "foo bar ", "foo bar", "foo ba") {
@@ -54,10 +60,16 @@ foreach my $arg ("foo b", "foo ", "foo", "fo", "f", "") {
like lm(rx($arg)), qr/main::lm\(qr\(\Q$arg\E\)u?\)/;
}
like lm(qr/foo.bar$/sm), qr/main::lm\(qr\(fo\)\.\.\.u?ms\)/;
-like lm(qr/L${chr_e9}on \x{2603} !/), qr/main::lm\(qr\(L\\\)\.\.\.u?\)/;
-like lm(rx("L${chr_e9}on \x{2603} !")), qr/main::lm\(qr\(L\\\)\.\.\.u?\)/;
-like lm(qr/L${chr_e9}on\x{2603}/), qr/main::lm\(qr\(L\\\)\.\.\.u?\)/;
-like lm(rx("L${chr_e9}on\x{2603}")), qr/main::lm\(qr\(L\\\)\.\.\.u?\)/;
+
+SKIP: {
+ skip "wide-character-related bug in pre-5.18 perls", 4 if $] lt 5.017_001;
+
+ like lm(qr/L${chr_e9}on \x{2603} !/), qr/main::lm\(qr\(L\\\)\.\.\.u?\)/;
+ like lm(rx("L${chr_e9}on \x{2603} !")), qr/main::lm\(qr\(L\\\)\.\.\.u?\)/;
+ like lm(qr/L${chr_e9}on\x{2603}/), qr/main::lm\(qr\(L\\\)\.\.\.u?\)/;
+ like lm(rx("L${chr_e9}on\x{2603}")), qr/main::lm\(qr\(L\\\)\.\.\.u?\)/;
+}
+
like lm(qr/foo\x{2603}/), qr/main::lm\(qr\(fo\)\.\.\.u?\)/;
like lm(rx("foo\x{2603}")), qr/main::lm\(qr\(fo\)\.\.\.u?\)/;
@@ -65,7 +77,12 @@ $Carp::MaxArgLen = 0;
foreach my $arg ("wibble:" x 20, "foo bar baz") {
like lm(rx($arg)), qr/main::lm\(qr\(\Q$arg\E\)u?\)/;
}
-like lm(qr/L${chr_e9}on\x{2603}/), qr/main::lm\(qr\(L\\x\{?${e9}\}?on\\x\{2603\}\)u?\)/;
-like lm(rx("L${chr_e9}on\x{2603}")), qr/main::lm\(qr\(L${xe9_rx}on${x2603_rx}\)u?\)/;
+
+SKIP: {
+ skip "wide-character-related bug in pre-5.18 perls", 2 if $] lt 5.017_001;
+
+ like lm(qr/L${chr_e9}on\x{2603}/), qr/main::lm\(qr\(L\\x\{?${e9}\}?on\\x\{2603\}\)u?\)/;
+ like lm(rx("L${chr_e9}on\x{2603}")), qr/main::lm\(qr\(L${xe9_rx}on${x2603_rx}\)u?\)/;
+}
1;