summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2016-10-05 18:34:15 -0600
committerKarl Williamson <khw@cpan.org>2016-10-13 11:18:12 -0600
commitef652b2e6f462d1affda9b4fceb9f412473e128e (patch)
treeb437dabc5c2839748c84b4ad24885ec821d249c8
parent96f5e3aa7b956a03b55043352ff2c96cadcebd61 (diff)
downloadperl-ef652b2e6f462d1affda9b4fceb9f412473e128e.tar.gz
APItest/t/utf8.t: Add missing test
Under some circumstances we weren't validating that the generated warnings are correct. This required reordering some 'if' tests, and revised special casing of the overflow test.
-rw-r--r--ext/XS-APItest/t/utf8.t30
1 files changed, 16 insertions, 14 deletions
diff --git a/ext/XS-APItest/t/utf8.t b/ext/XS-APItest/t/utf8.t
index f104c5dd4b..c6d78bf27b 100644
--- a/ext/XS-APItest/t/utf8.t
+++ b/ext/XS-APItest/t/utf8.t
@@ -1921,20 +1921,10 @@ foreach my $test (@tests) {
diag $call;
}
- if (! $do_warning
- && ($warning eq 'utf8' || $warning eq $category))
- {
- if (!is(scalar @warnings, 0,
- "$this_name: No warnings generated"))
- {
- diag $call;
- output_warnings(@warnings);
+ if ($will_overflow) {
+ if (! $do_warning && $warning eq 'utf8') {
+ goto no_warnings_expected;
}
- }
- elsif ($will_overflow
- && ! $disallow_flag
- && $warning eq 'utf8')
- {
# Will get the overflow message instead of the expected
# message under these circumstances, as they would
@@ -1954,9 +1944,12 @@ foreach my $test (@tests) {
output_warnings(@warnings) if scalar @warnings;
}
}
- elsif ($warn_flag
+ elsif ( ! $do_warning
&& ($warning eq 'utf8' || $warning eq $category))
{
+ goto no_warnings_expected;
+ }
+ elsif ($warn_flag) {
if (is(scalar @warnings, 1,
"$this_name: Got a single warning "))
{
@@ -1973,6 +1966,15 @@ foreach my $test (@tests) {
}
}
}
+ else {
+ no_warnings_expected:
+ unless (is(scalar @warnings, 0,
+ "$this_name: Got no warnings"))
+ {
+ diag $call;
+ output_warnings(@warnings);
+ }
+ }
# Check CHECK_ONLY results when the input is disallowed. Do
# this when actually disallowed, not just when the