diff options
Diffstat (limited to 'src/test/java/org/shedlang/compiler/ast')
| -rw-r--r-- | src/test/java/org/shedlang/compiler/ast/untyped/UntypedCallNodeMatcher.java | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/test/java/org/shedlang/compiler/ast/untyped/UntypedCallNodeMatcher.java b/src/test/java/org/shedlang/compiler/ast/untyped/UntypedCallNodeMatcher.java index 3514b522..64cbe0dd 100644 --- a/src/test/java/org/shedlang/compiler/ast/untyped/UntypedCallNodeMatcher.java +++ b/src/test/java/org/shedlang/compiler/ast/untyped/UntypedCallNodeMatcher.java @@ -5,10 +5,7 @@ import org.pcollections.PVector; import org.shedlang.compiler.testing.MatcherBuilder; import org.zwobble.precisely.Matcher; -import java.util.Optional; - -import static org.zwobble.precisely.Matchers.equalTo; -import static org.zwobble.precisely.Matchers.has; +import static org.zwobble.precisely.Matchers.*; public class UntypedCallNodeMatcher extends MatcherBuilder<UntypedExpressionNode, UntypedCallNode, UntypedCallNodeMatcher> { public static UntypedCallNodeMatcher empty() { @@ -29,10 +26,22 @@ public class UntypedCallNodeMatcher extends MatcherBuilder<UntypedExpressionNode return new UntypedCallNodeMatcher(submatchers); } + public UntypedCallNodeMatcher withoutTypeLevelArgs() { + return with(has("typeLevelArgs", x -> x.typeLevelArgs(), isOptionalEmpty())); + } + public UntypedCallNodeMatcher withTypeLevelArgs( - Matcher<? super Optional<? extends Iterable<? extends UntypedTypeLevelExpressionNode>>> typeLevelArgs + Matcher<? super Iterable<? extends UntypedTypeLevelExpressionNode>> typeLevelArgs ) { - return with(has("typeLevelArgs", x -> x.typeLevelArgs(), typeLevelArgs)); + return with(has( + "typeLevelArgs", + x -> x.typeLevelArgs(), + isOptionalOf(has( + "args", + x -> x.args(), + typeLevelArgs + )) + )); } public UntypedCallNodeMatcher withArgs(Matcher<UntypedArgsNode> args) { |
