Package 

Class AstMatcherDslAdapterKt

    • Method Summary

      Modifier and Type Method Description
      final <N extends Node> Unit shouldMatchNode(Node $self, Boolean ignoreChildren, Function1<TreeNodeWrapper<Node, N>, Unit> nodeSpec) A shorthand for baseShouldMatchSubtree providing the NodeTreeLikeAdapter.
      final <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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • matchNode

         final <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.