Skip to content

Commit c928b28

Browse files
committed
fix reporting of line number
1 parent 5bd52dd commit c928b28

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

xt/perl-nbsp.t

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ plan +@files;
1212
for @files.sort -> $file {
1313
my $ok = True;
1414
my $row = 0;
15+
my @bad;
1516
for $file.IO.slurp.lines -> $line {
1617
$row++;
1718
if $line ~~ / ^ \s+ / {
@@ -20,13 +21,14 @@ for @files.sort -> $file {
2021
for $line ~~ m:g/ <!after 'implementing '> 'Perl' $<space>=(\s+) \d / -> $match {
2122
my $spaces = ~$match<space>;
2223
if $spaces.chars != 1 || $spaces.uniname ne "NO-BREAK SPACE" {
23-
$ok = False; last;
24+
$ok = False;
25+
@bad.push: $row;
2426
}
2527
}
2628
}
2729
my $error = $file;
2830
if !$ok {
29-
$error ~= " (line $row)";
31+
$error ~= " (line{@bad>1 ?? "s" !! ""} {@bad.join: ', '})";
3032
}
3133
ok $ok, "$error: Perl followed by a version should have a single non-breaking space." ;
3234
}

0 commit comments

Comments
 (0)