diff options
author | Karl Williamson <khw@cpan.org> | 2017-06-30 13:14:57 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2017-07-12 21:14:25 -0600 |
commit | 4c210ae9fdfacb3cd9e99e11f0a1b017805effa6 (patch) | |
tree | 9ae6d1a30af05414c151b9541e5135ceafde21c8 | |
parent | 6d736463b2cba639a7af7b09134aa79854c4dcd8 (diff) | |
download | perl-4c210ae9fdfacb3cd9e99e11f0a1b017805effa6.tar.gz |
APItest/t/utf8_warn_base.pl: Move some tests from loop
These test if any warnings are generated. None are ever likely to be
given the way things work. We can test after the loop that none of the
iterations generated warnings, as any would accumulate.
-rw-r--r-- | ext/XS-APItest/t/utf8_warn_base.pl | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/XS-APItest/t/utf8_warn_base.pl b/ext/XS-APItest/t/utf8_warn_base.pl index 737e73192d..754753de6d 100644 --- a/ext/XS-APItest/t/utf8_warn_base.pl +++ b/ext/XS-APItest/t/utf8_warn_base.pl @@ -810,7 +810,9 @@ foreach my $test (@tests) { or output_warnings(@warnings_gotten); # Test partial character handling, for each byte not a full character + my $did_test_partial = 0; for (my $j = 1; $j < $length - 1; $j++) { + $did_test_partial = 1; my $partial = substr($bytes, 0, $j); my $ret_should_be; my $comment; @@ -838,10 +840,13 @@ foreach my $test (@tests) { . ", $disallow_flags), $comment: returns $ret_should_be") or diag "The flags mean " . flags_to_text($disallow_flags, \@utf8n_flags_to_text); + } + + if ($did_test_partial) { is(scalar @warnings_gotten, 0, " And is_utf8_valid_partial_char_flags()" - . " generated no warnings") - or output_warnings(@warnings_gotten); + . " generated no warnings for any of the lengths") + or output_warnings(@warnings_gotten); } } } |