File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ # !/usr/bin/env perl6
2
+
3
+ use v6 ;
4
+ use Test ;
5
+ use lib ' lib' ;
6
+ use Test-Files;
7
+ use Pod ::To::HTML;
8
+ use MONKEY-SEE-NO-EVAL ;
9
+
10
+ # Every .pod6 file in the Type directory.
11
+ my @ files = Test-Files. files. grep ({$ _ . ends-with : ' .pod6' }). grep (* ~~ /Type | Language /);
12
+
13
+ plan + @ files ;
14
+
15
+ for @ files -> $ file {
16
+ my @ lines ;
17
+ my Int $ line-no = 1 ;
18
+ my @ links = $ file . IO . lines . grep ( * ~~ / https? /);
19
+ my @ links-not-links ;
20
+ for @ links -> $ link {
21
+ my $ pod = qq :to /END /;
22
+ =pod
23
+ $ link
24
+ =pod
25
+ END
26
+ my @ number-of-links = ( $ link ~~ m :g { https? } );
27
+ my $ html = pod2html(EVAL ($ pod ~ " \n \$=pod" ));
28
+ my @ number-of-hrefs = ( $ html ~~ m :g {a\s + href\= } );
29
+ push @ links-not-links , $ link if + @ number-of-links > + @ number-of-hrefs ;
30
+ }
31
+ if @ links-not-links {
32
+ flunk " $ file uses non-linked links « { @ links-not-links } »" ;
33
+ } else {
34
+ pass " $ file return types are ok" ;
35
+ }
36
+ }
You can’t perform that action at this time.
0 commit comments