|
35 | 35 | }
|
36 | 36 | }
|
37 | 37 | close $FH;
|
38 |
| -print "We are aware of " . scalar(keys %countries) . " territories \n"; |
| 38 | +my $total_countries = scalar(keys %countries); |
| 39 | +print "We are aware of " . $total_countries . " territories \n"; |
39 | 40 |
|
40 | 41 |
|
41 | 42 | # which countries have tests?
|
|
50 | 51 | $f = uc($f);
|
51 | 52 | $test_countries{$f} = 1;
|
52 | 53 | }
|
53 |
| -print "We have tests for " . scalar(keys %test_countries) . " territories \n"; |
| 54 | +my $test_countries = scalar(keys %test_countries); |
| 55 | +my $test_perc = int(100 * $test_countries / $total_countries ); |
| 56 | +print "We have tests for " . $test_countries . ' (' |
| 57 | + . $test_perc . '%) territories' . "\n"; |
54 | 58 | if ($details){
|
55 | 59 | print "We need tests for:\n";
|
56 | 60 | foreach my $cc (sort keys %countries){
|
|
70 | 74 | }
|
71 | 75 | }
|
72 | 76 | close $RFH;
|
73 |
| -print "We have rules for " . scalar(keys %rules) . " territories \n"; |
| 77 | +my $rules_countries = scalar(keys %rules); |
| 78 | +my $rules_perc = int(100 * $rules_countries / $total_countries ); |
| 79 | +print "We have rules for " . $rules_countries . ' (' |
| 80 | + . $rules_perc . '%) territories' . "\n"; |
| 81 | + |
74 | 82 | if ($details){
|
75 | 83 | print "We need rules for:\n";
|
76 | 84 | foreach my $cc (sort keys %countries){
|
|
79 | 87 | }
|
80 | 88 | }
|
81 | 89 |
|
82 |
| - |
83 | 90 | # find territories without rules or tests
|
84 | 91 | my %neither;
|
85 | 92 | foreach my $cc (sort keys %countries){
|
86 | 93 | next if (defined($rules{$cc}));
|
87 | 94 | next if (defined($test_countries{$cc}));
|
88 | 95 | $neither{$cc} = 1;
|
89 | 96 | }
|
90 |
| -print scalar(keys %neither) . " territories have neither rules nor tests\n"; |
| 97 | +my $neither_countries = scalar(keys %neither); |
| 98 | +my $neither_perc = int(100 * $neither_countries / $total_countries ); |
| 99 | +print $neither_countries . ' (' . $neither_perc . '%) territories have neither rules nor tests' . "\n"; |
91 | 100 | if ($details){
|
92 | 101 | print "Territories with no test and no rules:\n";
|
93 | 102 | foreach my $cc (sort keys %neither){
|
|
96 | 105 | }
|
97 | 106 |
|
98 | 107 |
|
99 |
| - |
100 |
| - |
101 |
| - |
102 |
| - |
103 | 108 | sub usage {
|
104 | 109 | print "\tHow many territories have formatting rules and tests?\n";
|
105 | 110 | print "\tBy default prints just a high level summary\n";
|
|
0 commit comments