summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2016-12-18 13:38:01 -0700
committerKarl Williamson <khw@cpan.org>2016-12-23 11:41:32 -0700
commit42c03a9af95fa27e50f4171d10a497b969c5f994 (patch)
treeac53d9a36c24d6d24607929c03cccd8fe00156d3 /ext
parentc5546fac5a0a0ed4f70fea3b9306726d88fc73d7 (diff)
downloadperl-42c03a9af95fa27e50f4171d10a497b969c5f994.tar.gz
APItest/t/handy.t: Bring final special case into loop
All the tests in this file are now in two loops, one for the isFOO() macros, and the other for the toFOO() macros. Thus the main logic applies to all, and tests can be added or changed easily.
Diffstat (limited to 'ext')
-rw-r--r--ext/XS-APItest/t/handy.t19
1 files changed, 8 insertions, 11 deletions
diff --git a/ext/XS-APItest/t/handy.t b/ext/XS-APItest/t/handy.t
index eeefc52445..b08e8146d3 100644
--- a/ext/XS-APItest/t/handy.t
+++ b/ext/XS-APItest/t/handy.t
@@ -197,16 +197,6 @@ foreach my $name (sort keys %properties, 'octal') {
my $display_name = sprintf "\\x{%02X, %s}", $i, $char_name;
my $display_call = "is${function}( $display_name )";
- if ($name eq 'quotemeta') { # There is only one macro for this, and is
- # defined only for Latin1 range
- $ret = truth eval "test_is${function}($i)";
- if (is ($@, "", "$display_call didn't give error")) {
- my $truth = truth($matches && $i < 256);
- is ($ret, $truth, "${tab}And returns $truth");
- }
- next;
- }
-
foreach my $suffix ("", "_A", "_L1", "_LC", "_uni", "_uvchr",
"_LC_uvchr", "_utf8", "_LC_utf8")
{
@@ -229,6 +219,11 @@ foreach my $name (sort keys %properties, 'octal') {
elsif ($name eq 'octal') {
next if $suffix ne "" && $suffix ne '_A' && $suffix ne '_L1';
}
+ elsif ($name eq 'quotemeta') {
+ # There is only one macro for this, and is defined only for
+ # Latin1 range
+ next if $suffix ne ""
+ }
foreach my $locale ("", $base_locale, $utf8_locale) {
@@ -253,7 +248,9 @@ foreach my $name (sort keys %properties, 'octal') {
$truth = 0
if $suffix=~ / ^ ( _A | _L [1C] )? $ /x;
}
- elsif (utf8::native_to_unicode($i) >= 128) {
+ elsif ( utf8::native_to_unicode($i) >= 128
+ && $name ne 'quotemeta')
+ {
# The no-suffix and _A functions are false
# for non-ASCII. So are _LC functions on a