@@ -37,19 +37,19 @@ plan tests => $total_tests;
3737foreach 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