-
public final class AstMatcherDslAdapterKt
-
-
Method Summary
Modifier and Type Method Description final static <N extends Node> UnitshouldMatchNode(Node $self, Boolean ignoreChildren, Function1<TreeNodeWrapper<Node, N>, Unit> nodeSpec)A shorthand for baseShouldMatchSubtree providing the NodeTreeLikeAdapter. final static <N extends Node> Function1<Node, Unit>matchNode(Boolean ignoreChildren, Function1<TreeNodeWrapper<Node, N>, Unit> nodeSpec)Returns an assertion function asserting that its parameter conforms to the given NodeSpec. -
-
Method Detail
-
shouldMatchNode
final static <N extends Node> Unit shouldMatchNode(Node $self, Boolean ignoreChildren, Function1<TreeNodeWrapper<Node, N>, Unit> nodeSpec)
A shorthand for baseShouldMatchSubtree providing the NodeTreeLikeAdapter.
-
matchNode
final static <N extends Node> Function1<Node, Unit> matchNode(Boolean ignoreChildren, Function1<TreeNodeWrapper<Node, N>, Unit> nodeSpec)
Returns an assertion function asserting that its parameter conforms to the given NodeSpec.
Use it with io.kotest.matchers.should, e.g.
node should matchNode<ASTExpression> {}.See also the samples on TreeNodeWrapper.
- Parameters:
ignoreChildren- If true, calls to TreeNodeWrapper.child in the nodeSpec are forbidden.nodeSpec- Sequence of assertions to carry out on the node, which can be referred to by TreeNodeWrapper.it.
-
-
-
-