aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/shedlang/compiler/ast
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2023-10-20 17:51:33 +0100
committerMichael Williamson <mike@zwobble.org>2023-10-20 17:51:33 +0100
commitc57ca9e4d30e07d2ff0ba2f113e905a3c3794c75 (patch)
tree0ad284e2ac442edd68aa32e171f84a1dcfc2ec8c /src/test/java/org/shedlang/compiler/ast
parentd2df851ca20b0ec02cb3450c861288d65d45f165 (diff)
Parse imports in namespace
Diffstat (limited to 'src/test/java/org/shedlang/compiler/ast')
-rw-r--r--src/test/java/org/shedlang/compiler/ast/untyped/Untyped.java2
-rw-r--r--src/test/java/org/shedlang/compiler/ast/untyped/UntypedNodeMatchers.java7
2 files changed, 8 insertions, 1 deletions
diff --git a/src/test/java/org/shedlang/compiler/ast/untyped/Untyped.java b/src/test/java/org/shedlang/compiler/ast/untyped/Untyped.java
index 09067087..2c2aad8c 100644
--- a/src/test/java/org/shedlang/compiler/ast/untyped/Untyped.java
+++ b/src/test/java/org/shedlang/compiler/ast/untyped/Untyped.java
@@ -118,7 +118,7 @@ public class Untyped {
NamespaceName namespaceName,
List<UntypedNamespaceStatementNode> body
) {
- return new UntypedNamespaceNode(namespaceName, body, Sources.NULL);
+ return new UntypedNamespaceNode(namespaceName, List.of(), body, Sources.NULL);
}
public static UntypedNamespaceNode namespace(List<UntypedNamespaceStatementNode> body) {
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 fdbb8f53..6d426bf4 100644
--- a/src/test/java/org/shedlang/compiler/ast/untyped/UntypedNodeMatchers.java
+++ b/src/test/java/org/shedlang/compiler/ast/untyped/UntypedNodeMatchers.java
@@ -1,5 +1,6 @@
package org.shedlang.compiler.ast.untyped;
+import org.shedlang.compiler.types.NamespaceName;
import org.zwobble.precisely.Matcher;
import java.math.BigInteger;
@@ -132,6 +133,12 @@ public class UntypedNodeMatchers {
);
}
+ public static Matcher<UntypedImportNode> isUntypedImportNode(
+ NamespaceName namespaceName
+ ) {
+ return has("namespaceName", x -> x.namespaceName(), equalTo(namespaceName));
+ }
+
public static Matcher<UntypedExpressionNode> isUntypedIntLiteralNode(int value) {
return isUntypedIntLiteralNode(BigInteger.valueOf(value));
}