From 56a85032922b2ccda478b54ad82410492b69d74c Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sun, 2 Jul 2017 10:34:12 -0600 Subject: [PATCH] t/re/pat_advanced.t: Revise some tests These tests used the highest available code points, but those will soon be made illegal. The tests don't need to be for these particular code points, but there do need to be tests of user-defined properties of high code points, so this commit changes to use the highest ones that will be legal after that change. --- t/re/pat_advanced.t | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/t/re/pat_advanced.t b/t/re/pat_advanced.t index 68c827a..3f2d6c3 100644 --- a/t/re/pat_advanced.t +++ b/t/re/pat_advanced.t @@ -2333,45 +2333,44 @@ EOF } # User-defined Unicode properties to match above-Unicode code points - sub Is_32_Bit_Super { return "110000\tFFFFFFFF\n" } + sub Is_31_Bit_Super { return "110000\t7FFFFFFF\n" } sub Is_Portable_Super { return '!utf8::Any' } # Matches beyond 32 bits { # Assertion was failing on on 64-bit platforms; just didn't work on 32. no warnings qw(non_unicode portable); - no warnings 'deprecated'; # These are above IV_MAX use Config; # We use 'ok' instead of 'like' because the warnings are lexically # scoped, and want to turn them off, so have to do the match in this # scope. if ($Config{uvsize} < 8) { - ok(chr(0xFFFF_FFFE) =~ /\p{Is_32_Bit_Super}/, - "chr(0xFFFF_FFFE) can match a Unicode property"); - ok(chr(0xFFFF_FFFF) =~ /\p{Is_32_Bit_Super}/, - "chr(0xFFFF_FFFF) can match a Unicode property"); - my $p = qr/^[\x{FFFF_FFFF}]$/; - ok(chr(0xFFFF_FFFF) =~ $p, - "chr(0xFFFF_FFFF) can match itself in a [class]"); - ok(chr(0xFFFF_FFFF) =~ $p, # Tests any caching - "chr(0xFFFF_FFFF) can match itself in a [class] subsequently"); + ok(chr(0x7FFF_FFFE) =~ /\p{Is_31_Bit_Super}/, + "chr(0x7FFF_FFFE) can match a Unicode property"); + ok(chr(0x7FFF_FFFF) =~ /\p{Is_31_Bit_Super}/, + "chr(0x7FFF_FFFF) can match a Unicode property"); + my $p = qr/^[\x{7FFF_FFFF}]$/; + ok(chr(0x7FFF_FFFF) =~ $p, + "chr(0x7FFF_FFFF) can match itself in a [class]"); + ok(chr(0x7FFF_FFFF) =~ $p, # Tests any caching + "chr(0x7FFF_FFFF) can match itself in a [class] subsequently"); } else { no warnings 'overflow'; - ok(chr(0xFFFF_FFFF_FFFF_FFFE) =~ qr/\p{Is_Portable_Super}/, - "chr(0xFFFF_FFFF_FFFF_FFFE) can match a Unicode property"); - ok(chr(0xFFFF_FFFF_FFFF_FFFF) =~ qr/^\p{Is_Portable_Super}$/, - "chr(0xFFFF_FFFF_FFFF_FFFF) can match a Unicode property"); + ok(chr(0x7FFF_FFFF_FFFF_FFFE) =~ qr/\p{Is_Portable_Super}/, + "chr(0x7FFF_FFFF_FFFF_FFFE) can match a Unicode property"); + ok(chr(0x7FFF_FFFF_FFFF_FFFF) =~ qr/^\p{Is_Portable_Super}$/, + "chr(0x7FFF_FFFF_FFFF_FFFF) can match a Unicode property"); - my $p = qr/^[\x{FFFF_FFFF_FFFF_FFFF}]$/; - ok(chr(0xFFFF_FFFF_FFFF_FFFF) =~ $p, - "chr(0xFFFF_FFFF_FFFF_FFFF) can match itself in a [class]"); - ok(chr(0xFFFF_FFFF_FFFF_FFFF) =~ $p, # Tests any caching - "chr(0xFFFF_FFFF_FFFF_FFFF) can match itself in a [class] subsequently"); + my $p = qr/^[\x{7FFF_FFFF_FFFF_FFFF}]$/; + ok(chr(0x7FFF_FFFF_FFFF_FFFF) =~ $p, + "chr(0x7FFF_FFFF_FFFF_FFFF) can match itself in a [class]"); + ok(chr(0x7FFF_FFFF_FFFF_FFFF) =~ $p, # Tests any caching + "chr(0x7FFF_FFFF_FFFF_FFFF) can match itself in a [class] subsequently"); # This test is because something was declared as 32 bits, but # should have been cast to 64; only a problem where # sizeof(STRLEN) != sizeof(UV) - ok(chr(0xFFFF_FFFF_FFFF_FFFE) !~ qr/\p{Is_32_Bit_Super}/, "chr(0xFFFF_FFFF_FFFF_FFFE) shouldn't match a range ending in 0xFFFF_FFFF"); + ok(chr(0x7FFF_FFFF_FFFF_FFFE) !~ qr/\p{Is_31_Bit_Super}/, "chr(0x7FFF_FFFF_FFFF_FFFE) shouldn't match a range ending in 0x7FFF_FFFF"); } } -- 1.8.3.1