Revision 9b220b88
Von Sven Schöling vor etwa 15 Jahren hinzugefügt
t/002goodperl.t | ||
---|---|---|
32 | 32 |
|
33 | 33 |
use Support::Files; |
34 | 34 |
|
35 |
use Test::More tests => (scalar(@Support::Files::testitems) * 3);
|
|
35 |
use Test::More tests => scalar @Support::Files::testitems * 2;
|
|
36 | 36 |
|
37 | 37 |
my @testitems = @Support::Files::testitems; # get the files to test. |
38 | 38 |
|
... | ... | |
78 | 78 |
} |
79 | 79 |
} |
80 | 80 |
|
81 |
TODO: { |
|
82 |
local $TODO = 'strict is not implemented thoroughly yet'; |
|
81 | 83 |
foreach my $file (@testitems) { |
82 | 84 |
my $found_use_strict = 0; |
83 | 85 |
$file =~ s/\s.*$//; # nuke everything after the first space (#comment) |
... | ... | |
99 | 101 |
ok(0,"$file DOES NOT use strict --WARNING"); |
100 | 102 |
} |
101 | 103 |
} |
102 |
|
|
103 |
# Check to see that all error messages use tags (for l10n reasons.) |
|
104 |
foreach my $file (@testitems) { |
|
105 |
$file =~ s/\s.*$//; # nuke everything after the first space (#comment) |
|
106 |
next if (!$file); # skip null entries |
|
107 |
if (! open (FILE, $file)) { |
|
108 |
ok(0,"could not open $file --WARNING"); |
|
109 |
next; |
|
110 |
} |
|
111 |
my $lineno = 0; |
|
112 |
my $error = 0; |
|
113 |
|
|
114 |
while (!$error && (my $file_line = <FILE>)) { |
|
115 |
$lineno++; |
|
116 |
if ($file_line =~ /Throw.*Error\("(.*?)"/) { |
|
117 |
if ($1 =~ /\s/) { |
|
118 |
ok(0,"$file has a Throw*Error call on line $lineno which doesn't use a tag --ERROR"); |
|
119 |
$error = 1; |
|
120 |
} |
|
121 |
} |
|
122 |
} |
|
123 |
|
|
124 |
ok(1,"$file uses Throw*Error calls correctly") if !$error; |
|
125 |
|
|
126 |
close(FILE); |
|
127 | 104 |
} |
128 | 105 |
|
129 | 106 |
exit 0; |
Auch abrufbar als: Unified diff
Modifikatioen an den Tests.