diff options
author | Dylan William Hardison <dylan@hardison.net> | 2017-09-27 22:25:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-27 22:25:49 +0200 |
commit | 3e13de0966e361ca4e70cfd2d781320f25d820d3 (patch) | |
tree | 9846f6a728d437ffb9829d530f12313d426f365c /t/002goodperl.t | |
parent | 40c4401db5525617278deb8bfaf5481f08e4cf97 (diff) | |
download | bugzilla-3e13de0966e361ca4e70cfd2d781320f25d820d3.tar.gz bugzilla-3e13de0966e361ca4e70cfd2d781320f25d820d3.tar.xz |
Bug 1402878 - Add some more sanity-type tests, including perl critic
Diffstat (limited to 't/002goodperl.t')
-rw-r--r-- | t/002goodperl.t | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/t/002goodperl.t b/t/002goodperl.t index d770b7b4f..5f201160b 100644 --- a/t/002goodperl.t +++ b/t/002goodperl.t @@ -54,6 +54,8 @@ foreach my $file (@testitems) { } elsif ($ext eq "cgi") { # cgi files must be taint checked $flags = 'T'; + } elsif ($ext eq 't') { + $flags = ''; } else { ok(0, "$file has shebang but unknown extension"); next; @@ -129,20 +131,20 @@ foreach my $file (@testitems) { } my $lineno = 0; my $error = 0; - + while (!$error && (my $file_line = <FILE>)) { $lineno++; if ($file_line =~ /Throw.*Error\("(.*?)"/) { if ($1 =~ /\s/) { - ok(0,"$file has a Throw*Error call on line $lineno + ok(0,"$file has a Throw*Error call on line $lineno which doesn't use a tag --ERROR"); - $error = 1; + $error = 1; } } } - + ok(1,"$file uses Throw*Error calls correctly") if !$error; - + close(FILE); } |