@@ -15,32 +15,37 @@ Ensure any text that isn't a code example has valid POD6
15
15
16
16
my $ max-jobs = % * ENV <TEST_THREADS > // 2 ;
17
17
18
- my @ files = Test-Files. files. grep ({$ _ . ends-with : ' .pod6' | ' .t ' });
19
-
20
- plan + @ files ;
18
+ my @ files-pod = Test-Files. files. grep ({$ _ . ends-with : ' .pod6' });
19
+ my @ files-t = Test-Files . files . grep ({ $ _ . ends-with : ' .t ' });
20
+ plan + @ files-t + + @ files-pod ;
21
21
22
22
my % data ;
23
+ test-files( @ files-pod );
24
+ test-files( @ files-t );
23
25
24
26
sub test-it ($ job ) {
25
27
my $ file = $ job . command[* - 1 ];
26
28
ok ! $ job . exitcode && ! % data {$ file }, " $ file has clean POD6"
27
29
}
28
30
29
- my @ jobs ;
30
- % data {@ files } = 0 xx @ files ;
31
- for @ files -> $ file {
32
- my $ p = Proc ::Async. new ($ * EXECUTABLE-NAME , ' --doc' , $ file );
33
- $ p . stdout. tap : {;};
34
- $ p . stderr. tap : {
35
- % * ENV <P6_DOC_TEST_VERBOSE > and diag " $ file STDERR: $ _" ;
36
- % data {$ file } = 1 ;
37
- }
38
- push @ jobs : $ p . start;
39
- if + @ jobs > $ max-jobs {
40
- test-it(await @ jobs . shift );
31
+ sub test-files ( @ files ) {
32
+ my @ jobs ;
33
+ % data {@ files } = 0 xx @ files ;
34
+ for @ files -> $ file {
35
+ my $ p = Proc ::Async. new ($ * EXECUTABLE-NAME , ' --doc' , $ file );
36
+ $ p . stdout. tap : {;};
37
+ $ p . stderr. tap : {
38
+ % * ENV <P6_DOC_TEST_VERBOSE > and diag " $ file STDERR: $ _" ;
39
+ % data {$ file } = 1 ;
40
+ }
41
+ push @ jobs : $ p . start;
42
+ if + @ jobs > $ max-jobs {
43
+ test-it(await @ jobs . shift );
44
+ }
41
45
}
46
+
47
+ for @ jobs . map : {await $ _ } -> $ r { test-it($ r ) }
42
48
}
43
49
44
- for @ jobs . map : {await $ _ } -> $ r { test-it($ r ) }
45
50
46
51
# vim: expandtab shiftwidth=4 ft=perl6
0 commit comments