Skip to content

Commit 4441983

Browse files
authored
Merge pull request #22 from ppisar/skip_l10n_tests
t/01-l10n.t: Skip tests properly
2 parents 806012e + 7273da3 commit 4441983

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

t/01-l10n.t

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,19 @@ plan tests => $total_tests;
3737
foreach my $lang_code ( sort keys %lang_tests ) {
3838
my $po_file = File::Spec->catfile('locale', $lang_code, 'LC_MESSAGES', 'rdapper.po');
3939

40-
unless (-f $po_file) {
41-
diag("Skipping tests for '$lang_code': $po_file not found.");
42-
next;
43-
}
40+
SKIP: {
41+
skip("Skipping tests for '$lang_code': $po_file not found.",
42+
scalar keys %{ $lang_tests{$lang_code} }) unless -f $po_file;
4443

45-
# Parse the .po file into a hash
46-
my %translations = parse_po_file($po_file);
44+
# Parse the .po file into a hash
45+
my %translations = parse_po_file($po_file);
4746

48-
# Run the specific tests for this language
49-
foreach my $original ( sort keys %{ $lang_tests{$lang_code} } ) {
50-
my $expected = $lang_tests{$lang_code}->{$original};
51-
my $translated = $translations{$original} // '';
52-
is($translated, $expected, "[$lang_code] '$original' -> '$expected'");
47+
# Run the specific tests for this language
48+
foreach my $original ( sort keys %{ $lang_tests{$lang_code} } ) {
49+
my $expected = $lang_tests{$lang_code}->{$original};
50+
my $translated = $translations{$original} // '';
51+
is($translated, $expected, "[$lang_code] '$original' -> '$expected'");
52+
}
5353
}
5454
}
5555

@@ -73,4 +73,4 @@ sub parse_po_file {
7373
}
7474
close $fh;
7575
return %data;
76-
}
76+
}

0 commit comments

Comments
 (0)