aboutsummaryrefslogtreecommitdiff
path: root/src/test/java
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2023-06-30 19:51:50 +0100
committerMichael Williamson <mike@zwobble.org>2023-06-30 19:51:50 +0100
commit334782898b59817a00a3ee9b8031cd974178d1ec (patch)
treed5b731976eeab3c52f47cb47e857e31a8f2639f7 /src/test/java
parent71c588ca231d275c5263b3e9ca5f7f57c4e048a1 (diff)
Define builtin modules outside of code gen
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/org/shedlang/compiler/stackir/StackCompilerNamespaceTests.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/java/org/shedlang/compiler/stackir/StackCompilerNamespaceTests.java b/src/test/java/org/shedlang/compiler/stackir/StackCompilerNamespaceTests.java
index 1ed17236..44f45c1d 100644
--- a/src/test/java/org/shedlang/compiler/stackir/StackCompilerNamespaceTests.java
+++ b/src/test/java/org/shedlang/compiler/stackir/StackCompilerNamespaceTests.java
@@ -4,6 +4,9 @@ import org.junit.jupiter.api.Test;
import org.shedlang.compiler.ast.typed.Typed;
import org.shedlang.compiler.ast.typed.TypedFunctionDefinitionNode;
import org.shedlang.compiler.stackir.instructions.DefineFunctionInstruction;
+import org.shedlang.compiler.stackir.instructions.FieldLoadInstruction;
+import org.shedlang.compiler.stackir.instructions.LocalStoreInstruction;
+import org.shedlang.compiler.stackir.instructions.NamespaceImportInstruction;
import org.shedlang.compiler.types.NamespaceName;
import org.shedlang.compiler.types.Types;
@@ -34,6 +37,11 @@ public class StackCompilerNamespaceTests {
var instructions = StackCompiler.compileNamespace(node);
assertThat(instructions, isSequence(
+ // TODO: test the builtin loading properly
+ instanceOf(NamespaceImportInstruction.class),
+ instanceOf(FieldLoadInstruction.class),
+ instanceOf(LocalStoreInstruction.class),
+
instanceOf(
DefineFunctionInstruction.class,
has("name", x -> x.name(), equalTo("f"))