Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Descend into pod items that can contain code
Previously, we skipped any code snippets that were inside
'item's, for example.
  • Loading branch information
coke committed Nov 2, 2018
1 parent 1bbf4e3 commit b3096ca
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion xt/examples-compilation.t
Expand Up @@ -50,7 +50,9 @@ my @examples;

my $counts = BagHash.new;
for @files -> $file {
for extract-pod($file.IO).contents -> $chunk {
my @chunks = extract-pod($file.IO).contents;
while @chunks {
my $chunk = @chunks.pop;
if $chunk ~~ Pod::Block::Code {
if $chunk.config<lang> && $chunk.config<lang> ne 'perl6' {
next; # Only testing Perl 6 snippets.
Expand All @@ -69,6 +71,10 @@ for @files -> $file {
'method', $chunk.config<method> // "",
'solo', $chunk.config<solo> // "",
);
} else {
if $chunk.^can('contents') {
@chunks.push(|$chunk.contents)
}
}
}
}
Expand Down

0 comments on commit b3096ca

Please sign in to comment.