summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2017-06-07 14:20:08 -0600
committerKarl Williamson <khw@cpan.org>2017-06-07 15:05:17 -0600
commit7e99522f0b6c062201bce39342ac82ce222e634d (patch)
tree1325f559cc8b7628fda2e6898ee9a124e1778455
parentfac71630f045e7ab325b37548d59b6558735e5c3 (diff)
downloadperl-7e99522f0b6c062201bce39342ac82ce222e634d.tar.gz
t/op/bop.t: Re-add in some tests
Commit 5d09ee1cb7b68f5e6fd15233bfe5048612e8f949 fatalized above 0xFF code points in the bitwise operators. It removed a bunch of tests in t/op/bop.t. I had independently been working on this task. An issue with removing such tests is are they there to be testing wide characters, or are they there to test UTF-8, and the use of above-FF was merely incidental? I had undertaken the tedious work of looking through the commits for all the tests that now fail to determine which category they were in. I concur mostly with the previous commit, but there were a few tests that I found that should have been retained, and modified to pass under the new scheme. This commit does that. Deprecated warnings no longer have to be turned off, as they were because of the previous tests that have now been removed.
-rw-r--r--t/op/bop.t13
1 files changed, 7 insertions, 6 deletions
diff --git a/t/op/bop.t b/t/op/bop.t
index c3f0085ad7..541d671b69 100644
--- a/t/op/bop.t
+++ b/t/op/bop.t
@@ -5,7 +5,6 @@
#
use warnings;
-no warnings 'deprecated';
BEGIN {
chdir 't' if -d 't';
@@ -19,7 +18,7 @@ BEGIN {
# If you find tests are failing, please try adding names to tests to track
# down where the failure is, and supply your new names as a patch.
# (Just-in-time test naming)
-plan tests => 341;
+plan tests => 471;
# numerics
ok ((0xdead & 0xbeef) == 0x9ead);
@@ -303,12 +302,12 @@ SKIP: {
$a &= "a";
ok($a =~ /a+$/, 'ASCII "a" is NUL-terminated');
- $b = "bb\x{100}";
+ $b = "bb\x{FF}";
+ utf8::upgrade($b);
$b &= "b";
ok($b =~ /b+$/, 'Unicode "b" is NUL-terminated');
}
-
# New string- and number-specific bitwise ops
{
use feature "bitwise";
@@ -361,7 +360,8 @@ SKIP: {
my %res;
-for my $str ("x", "\x{100}") {
+for my $str ("x", "\x{B6}") {
+ utf8::upgrade($str) if $str !~ /x/;
for my $chr (qw/S A H G X ( * F/) {
for my $op (qw/| & ^/) {
my $co = ord $chr;
@@ -401,8 +401,9 @@ for (
) {
my ($val, $orig, $type) = @$_;
- for (["x", "string"]) {
+ for (["x", "string"], ["\x{B6}", "utf8"]) {
my ($str, $desc) = @$_;
+ utf8::upgrade($str) if $desc =~ /utf8/;
$warn = 0;