diff options
Diffstat (limited to 'src/test/java/org/shedlang/compiler/ast')
| -rw-r--r-- | src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionBodyNodeMatcher.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionBodyNodeMatcher.java b/src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionBodyNodeMatcher.java index d392ec4d..f31f1e0b 100644 --- a/src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionBodyNodeMatcher.java +++ b/src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionBodyNodeMatcher.java @@ -3,8 +3,10 @@ package org.shedlang.compiler.ast.typed; import org.pcollections.Empty; import org.pcollections.PVector; import org.shedlang.compiler.testing.MatcherBuilder; +import org.shedlang.compiler.types.Type; import org.zwobble.precisely.Matcher; +import static org.zwobble.precisely.Matchers.equalTo; import static org.zwobble.precisely.Matchers.has; public class TypedFunctionBodyNodeMatcher extends MatcherBuilder< @@ -43,4 +45,8 @@ public class TypedFunctionBodyNodeMatcher extends MatcherBuilder< ) { return with(has("freeVariables", x -> x.freeVariables(), freeVariables)); } + + public TypedFunctionBodyNodeMatcher withType(Type type) { + return with(has("type", x -> x.type(), equalTo(type))); + } } |
