aboutsummaryrefslogtreecommitdiff
path: root/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionDefinitionNodeMatcher.java5
-rw-r--r--src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionExpressionNodeMatcher.java5
-rw-r--r--src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionSignatureNodeMatcher.java3
3 files changed, 6 insertions, 7 deletions
diff --git a/src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionDefinitionNodeMatcher.java b/src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionDefinitionNodeMatcher.java
index e12a187d..58527e4f 100644
--- a/src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionDefinitionNodeMatcher.java
+++ b/src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionDefinitionNodeMatcher.java
@@ -8,8 +8,7 @@ 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 TypedFunctionDefinitionNodeMatcher extends MatcherBuilder<TypedNamespaceStatementNode, TypedFunctionDefinitionNode, TypedFunctionDefinitionNodeMatcher> {
public static TypedFunctionDefinitionNodeMatcher empty() {
@@ -51,7 +50,7 @@ public class TypedFunctionDefinitionNodeMatcher extends MatcherBuilder<TypedName
}
public TypedFunctionDefinitionNodeMatcher withReturnType(Matcher<TypedTypeLevelExpressionNode<?>> returnType) {
- return with(has("returnType", x -> x.signature().returnType(), returnType));
+ return with(has("returnType", x -> x.signature().returnType(), isOptionalOf(returnType)));
}
public TypedFunctionDefinitionNodeMatcher withType(FunctionType type) {
diff --git a/src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionExpressionNodeMatcher.java b/src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionExpressionNodeMatcher.java
index b47fb39c..50319754 100644
--- a/src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionExpressionNodeMatcher.java
+++ b/src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionExpressionNodeMatcher.java
@@ -8,8 +8,7 @@ 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 TypedFunctionExpressionNodeMatcher extends MatcherBuilder<
TypedExpressionNode,
@@ -55,7 +54,7 @@ public class TypedFunctionExpressionNodeMatcher extends MatcherBuilder<
}
public TypedFunctionExpressionNodeMatcher withReturnType(Matcher<TypedTypeLevelExpressionNode<?>> returnType) {
- return with(has("returnType", x -> x.signature().returnType(), returnType));
+ return with(has("returnType", x -> x.signature().returnType(), isOptionalOf(returnType)));
}
public TypedFunctionExpressionNodeMatcher withType(FunctionType type) {
diff --git a/src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionSignatureNodeMatcher.java b/src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionSignatureNodeMatcher.java
index 2661d4fb..ca2e64ae 100644
--- a/src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionSignatureNodeMatcher.java
+++ b/src/test/java/org/shedlang/compiler/ast/typed/TypedFunctionSignatureNodeMatcher.java
@@ -8,6 +8,7 @@ import org.zwobble.precisely.Matcher;
import java.util.Optional;
import static org.zwobble.precisely.Matchers.has;
+import static org.zwobble.precisely.Matchers.isOptionalOf;
public class TypedFunctionSignatureNodeMatcher extends MatcherBuilder<
TypedFunctionSignatureNode,
@@ -45,6 +46,6 @@ public class TypedFunctionSignatureNodeMatcher extends MatcherBuilder<
}
public TypedFunctionSignatureNodeMatcher withReturnType(Matcher<TypedTypeLevelExpressionNode<?>> returnType) {
- return with(has("returnType", x -> x.returnType(), returnType));
+ return with(has("returnType", x -> x.returnType(), isOptionalOf(returnType)));
}
}