Class AstMatcherDslAdapterKt
-
- All Implemented Interfaces:
public final class AstMatcherDslAdapterKt
-
-
Field Summary
Fields Modifier and Type Field Description private final static MatchingConfig<Node>
DefaultMatchingConfig
-
Method Summary
Modifier and Type Method Description final MatchingConfig<Node>
getDefaultMatchingConfig()
final static <N extends Node> Function1<TreeNodeWrapper<Node, out N>, Unit>
ignoreResult(Function1<TreeNodeWrapper<Node, out N>, ?> $self)
final static <N extends Node> Unit
shouldMatchNode(Node $self, Boolean ignoreChildren, Function1<TreeNodeWrapper<Node, out N>, ?> nodeSpec)
A shorthand for baseShouldMatchSubtree providing the NodeTreeLikeAdapter. final static <N extends Node> Function1<Node, Unit>
matchNode(Boolean ignoreChildren, Function1<TreeNodeWrapper<Node, out N>, ?> nodeSpec)
Returns an assertion function asserting that its parameter conforms to the given NodeSpec. final static Unit
shouldMatchN(Node $self, Function1<TreeNodeWrapper<Node, out Node>, out Object> matcher)
The spec applies to the parent, shifted so that this node is the first node to be queried. -
-
Method Detail
-
getDefaultMatchingConfig
final MatchingConfig<Node> getDefaultMatchingConfig()
-
ignoreResult
final static <N extends Node> Function1<TreeNodeWrapper<Node, out N>, Unit> ignoreResult(Function1<TreeNodeWrapper<Node, out N>, ?> $self)
-
shouldMatchNode
final static <N extends Node> Unit shouldMatchNode(Node $self, Boolean ignoreChildren, Function1<TreeNodeWrapper<Node, out N>, ?> nodeSpec)
A shorthand for baseShouldMatchSubtree providing the NodeTreeLikeAdapter.
-
matchNode
final static <N extends Node> Function1<Node, Unit> matchNode(Boolean ignoreChildren, Function1<TreeNodeWrapper<Node, out N>, ?> 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.- Returns:
A matcher for AST nodes, suitable for use by io.kotest.matchers.should.
-
-
-
-