-
-
Save masak/ba06dbb58fc01228ef5e to your computer and use it in GitHub Desktop.
A nicer version with XPath searches
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v6; | |
use Test; | |
use _007::Test; | |
my $actions-ast = xpath(qast-of("lib/_007/Parser/Actions.pm")); | |
for $actions-ast.find("//method") -> $method { | |
my @constructions = $method.find: '//callmethod[@name="new"]/wval[1][@name="Q::Block"]'; | |
my @finishblocks = $method.find: '//callmethod[@name="finish-block"]/lexical[1][@name="self"]'; | |
is +@constructions, +@finishblocks, "finished all Q::Block.new in {$method.name}"; | |
} | |
done-testing; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment