|
Lines 31-37
my @exclusions = qw(
Link Here
|
| 31 |
); |
31 |
); |
| 32 |
@tt_files = array_minus @tt_files, @exclusions; |
32 |
@tt_files = array_minus @tt_files, @exclusions; |
| 33 |
|
33 |
|
| 34 |
plan tests => scalar(@tt_files) + 1; |
34 |
plan tests => scalar(@tt_files) * 2 + 1; |
| 35 |
|
35 |
|
| 36 |
my @translatable_attributes = qw(alt content title value label placeholder aria-label); |
36 |
my @translatable_attributes = qw(alt content title value label placeholder aria-label); |
| 37 |
|
37 |
|
|
Lines 80-96
my $checkers = [
Link Here
|
| 80 |
for my $filepath (@tt_files) { |
80 |
for my $filepath (@tt_files) { |
| 81 |
my $parser = C4::TTParser->new; |
81 |
my $parser = C4::TTParser->new; |
| 82 |
$parser->build_tokens($filepath); |
82 |
$parser->build_tokens($filepath); |
| 83 |
my @errors; |
83 |
my $errors = {}; |
| 84 |
while ( my $token = $parser->next_token ) { |
84 |
while ( my $token = $parser->next_token ) { |
| 85 |
my $attr = $token->{_attr}; |
85 |
my $attr = $token->{_attr}; |
| 86 |
next unless $attr; |
86 |
next unless $attr; |
| 87 |
|
87 |
|
| 88 |
for my $checker (@$checkers) { |
88 |
for my $checker (@$checkers) { |
| 89 |
my @e = $checker->{check}->( $checker, $filepath, $token ); |
89 |
my @e = $checker->{check}->( $checker, $filepath, $token ); |
| 90 |
push @errors, @e if @e; |
90 |
push @{ $errors->{ $checker->{description} } }, @e if @e; |
| 91 |
} |
91 |
} |
| 92 |
} |
92 |
} |
| 93 |
is( scalar(@errors), 0 ) or diag( "$filepath: " . join( ', ', @errors ) ); |
93 |
for my $checker (@$checkers) { |
|
|
94 |
my @errors = @{ $errors->{ $checker->{description} } || [] }; |
| 95 |
is( scalar(@errors), 0, $checker->{description} ) or diag( "$filepath: " . join( ', ', @errors ) ); |
| 96 |
} |
| 94 |
} |
97 |
} |
| 95 |
|
98 |
|
| 96 |
=head1 NAME |
99 |
=head1 NAME |
| 97 |
- |
|
|