File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change
1
+ # !/usr/bin/env raku
2
+
3
+ = begin overview
4
+
5
+ Check any L <> references for validity.
6
+
7
+ = end overview
8
+
9
+ use Test ;
10
+ use lib $ * PROGRAM . parent (2 ). child (' lib' );
11
+
12
+ use Test-Files;
13
+ use Pod ::Convenience;
14
+
15
+ my @ files = Test-Files. pods;
16
+
17
+ if @ files {
18
+ plan + @ files ;
19
+ } else {
20
+ plan : skip-all<No rakudoc files specified >
21
+ }
22
+
23
+ sub is-valid-c ($ contents ) {
24
+ for @$ contents -> $ string {
25
+ is $ string , $ string . trim , " C<$ string > no extra whitespace." ;
26
+ }
27
+ }
28
+
29
+ sub walk-content ($ x ) {
30
+ for $ x . contents -> $ contents {
31
+ next unless $ contents ;
32
+ for @$ contents -> $ item {
33
+ if $ item ~~ Pod ::FormattingCode and $ item . type eq ' C' {
34
+ is-valid-c($ item . contents);
35
+ } elsif $ item ! ~~ Str {
36
+ walk-content($ item );
37
+ }
38
+ }
39
+ }
40
+ }
41
+
42
+ for @ files -> $ file {
43
+ my @ chunks = extract-pod($ file ). contents;
44
+
45
+ # This emits pass or flunk for each local L<> found.
46
+ subtest $ file => {
47
+ walk-content($ _ ) for @ chunks ;
48
+ }
49
+ }
You can’t perform that action at this time.
0 commit comments