Skip to content

Commit 7c589cf

Browse files
committed
Check rendered docs, not raw pod
* respect TEST_THREADS * ignore tables (requires a slightly recent rakudo) * ignore some single-char non-letters, e.g.: / < > (Whoops; part of this commit went in with b895a84)
1 parent 221c00f commit 7c589cf

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

xt/duplicates.t

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ sub test-promise($promise) {
3232
test-it(%output{$file}, $file);
3333
}
3434

35-
my token word-min { <+alpha +digit +[']> };
36-
my token word-max { <word-min> | <[$@%()-]> };
37-
my token word-sep { <[,.;]> };
38-
3935
sub test-it(Str $output, Str $file) {
4036
my $ok = True;
4137

@@ -51,13 +47,7 @@ sub test-it(Str $output, Str $file) {
5147
}
5248
next unless $line.chars;
5349

54-
$line.=subst(/<< 'http' <+alpha +digit +[:/.]>+ /,'RANDOMURL'); # ignore URLS
55-
56-
# be slightly generous about what we consider a word
57-
#my @words = |$last-word, $line.comb: /(<word-max>+ <word-sep>?)/;
5850
my @words = |$last-word, $line.words.grep: *.chars;
59-
# but insure words have at least one letter.
60-
#@words = @words.grep(/<word-min>/);
6151

6252
if $line.ends-with('.') {
6353
$last-word = '';
@@ -67,7 +57,10 @@ sub test-it(Str $output, Str $file) {
6757

6858
my @line-dupes = @words.rotor(2=> -1).grep({$_[0] eq $_[1]}).map({$_[0]});
6959
for @line-dupes -> $dupe {
60+
# explicitly allowed duplicates
7061
next if $safe-dupes ~$dupe[0];
62+
# Single characters that are probably fine
63+
next if $dupe ~~ /^ [<:Sm>|<:CS>] $/;
7164
@dupes.push: "" ~ $dupe[0] ~ "” on line $line-num";
7265
}
7366
}

0 commit comments

Comments
 (0)