aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/shedlang/compiler/ast
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/org/shedlang/compiler/ast')
-rw-r--r--src/test/java/org/shedlang/compiler/ast/untyped/UntypedNodeMatchers.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/java/org/shedlang/compiler/ast/untyped/UntypedNodeMatchers.java b/src/test/java/org/shedlang/compiler/ast/untyped/UntypedNodeMatchers.java
index a848b601..acddc159 100644
--- a/src/test/java/org/shedlang/compiler/ast/untyped/UntypedNodeMatchers.java
+++ b/src/test/java/org/shedlang/compiler/ast/untyped/UntypedNodeMatchers.java
@@ -2,6 +2,8 @@ package org.shedlang.compiler.ast.untyped;
import org.zwobble.precisely.Matcher;
+import java.math.BigInteger;
+
import static org.zwobble.precisely.Matchers.*;
public class UntypedNodeMatchers {
@@ -29,6 +31,17 @@ public class UntypedNodeMatchers {
return UntypedFunctionDefinitionNodeMatcher.empty();
}
+ public static Matcher<UntypedExpressionNode> isUntypedIntLiteralNode(int value) {
+ return isUntypedIntLiteralNode(BigInteger.valueOf(value));
+ }
+
+ public static Matcher<UntypedExpressionNode> isUntypedIntLiteralNode(BigInteger value) {
+ return instanceOf(
+ UntypedIntLiteralNode.class,
+ has("value", x -> x.value(), equalTo(value))
+ );
+ }
+
public static Matcher<UntypedNamedArgNode> isUntypedNamedArgNode(
String name,
Matcher<UntypedExpressionNode> expression