diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-02-10 14:30:20 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-02-10 14:32:04 -0800 |
commit | 3cfe9c806f5c45049445a0194a340960268c902f (patch) | |
tree | efaf92ea67562757f4799871c41e80317db835d3 /t/porting | |
parent | d5422ff10428f68556f5f0f5abccf7bf360893d4 (diff) | |
download | perl-3cfe9c806f5c45049445a0194a340960268c902f.tar.gz |
diag.t: Validate severity of ck warn routines better
In the case of Perl_ck_warner and other _ck_ functions, we can tell
whether it is a severe/default warning or no by the _d suffix (or the
presence of ‘dep’ in the name for regcomp.c’s ckWARN* functions).
This caught one incorrect severity in perldiag.pod, which is also cor-
rected here.
Diffstat (limited to 't/porting')
-rw-r--r-- | t/porting/diag.t | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/t/porting/diag.t b/t/porting/diag.t index 2d98b57a20..a37b338b34 100644 --- a/t/porting/diag.t +++ b/t/porting/diag.t @@ -312,10 +312,17 @@ sub check_file { next; } + # Try to guess what the severity should be. In the case of + # Perl_ck_warner and other _ck_ functions, we can tell whether it is + # a severe/default warning or no by the _d suffix. In the case of + # other warn functions we cannot tell, because Perl_warner may be pre- + # ceded by if(ckWARN) or if(ckWARN_d). my $severity = !$routine ? '[PFX]' : $routine =~ /warn.*_d\z/ ? '[DS]' + : $routine =~ /ck_warn/ ? 'W' : $routine =~ /warn/ ? '[WDS]' - : $routine =~ /ckWARN\d*reg/ ? '[WDS]' + : $routine =~ /ckWARN.*dep/ ? 'D' + : $routine =~ /ckWARN\d*reg/ ? 'W' : $routine =~ /vWARN\d/ ? '[WDS]' : '[PFX]'; my $categories; @@ -405,7 +412,9 @@ sub check_message { if $entries{$key}{cattodo}; like $entries{$key}{severity}, $qr, - "severity is one of $severity for $key"; + $severity =~ /\[/ + ? "severity is one of $severity for $key" + : "severity is $severity for $key"; is $entries{$key}{category}, $categories, ($categories ? "categories are [$categories]" : "no category") |