Skip to content

Commit 41f63c3

Browse files
committed
Improved error message wording (singular/plural)
Signed-of-by: Henry Cox <[email protected]>
1 parent 606967b commit 41f63c3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

bin/genhtml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4482,11 +4482,12 @@ sub _synthesize
44824482
unless $main::no_sourceview;
44834483
$why = 'not found';
44844484
} else {
4485-
my $suffix =
4486-
$lcovutil::ignore[$lcovutil::ERROR_RANGE] ?
4487-
' ... synthesizing fake content for last ' .
4488-
($last_line - $currentLast) . ' lines.' :
4489-
'';
4485+
my $suffix = '';
4486+
if ($lcovutil::ignore[$lcovutil::ERROR_RANGE]) {
4487+
my $num = $last_line - $currentLast;
4488+
my $plural = $num == 1 ? 'line' : "$num lines";
4489+
$suffix = ' ... synthesizing fake content for last ' . $plural;
4490+
}
44904491
lcovutil::ignorable_error($lcovutil::ERROR_RANGE,
44914492
$self->path() . ' contains only ' . $currentLast .
44924493
' lines but coverage data refers to line ' .

0 commit comments

Comments
 (0)