aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/shedlang/compiler/stackir
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2023-06-13 20:35:55 +0100
committerMichael Williamson <mike@zwobble.org>2023-06-13 20:35:55 +0100
commitf2ab791334abe75807c4bff32b17fa379b466193 (patch)
tree243648c20fc20044fff8129a3ea272d8a9fe80a5 /src/test/java/org/shedlang/compiler/stackir
parent6366198588909777722d4834085ebdf9838f5828 (diff)
Put namespace name onto namespace nodes
Diffstat (limited to 'src/test/java/org/shedlang/compiler/stackir')
-rw-r--r--src/test/java/org/shedlang/compiler/stackir/StackCompilerNamespaceTests.java21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/test/java/org/shedlang/compiler/stackir/StackCompilerNamespaceTests.java b/src/test/java/org/shedlang/compiler/stackir/StackCompilerNamespaceTests.java
index a3b34c55..32ff72ba 100644
--- a/src/test/java/org/shedlang/compiler/stackir/StackCompilerNamespaceTests.java
+++ b/src/test/java/org/shedlang/compiler/stackir/StackCompilerNamespaceTests.java
@@ -18,16 +18,19 @@ public class StackCompilerNamespaceTests {
public void bodyOfNamespaceIsCompiledWithNamesBeingExported() {
var namespaceName = new NamespaceName(List.of("Example"));
- var node = Typed.namespace(List.of(
- TypedFunctionDefinitionNode.builder()
- .withName("f")
- .addPositionalParam("x", Typed.typeLevelReference("String", Types.STRING))
- .addNamedParam("y", Typed.typeLevelReference("Int", Types.INT))
- .addStatement(Typed.expressionStatement(Typed.stringLiteral("hello")))
- .build()
- ));
+ var node = Typed.namespace(
+ namespaceName,
+ List.of(
+ TypedFunctionDefinitionNode.builder()
+ .withName("f")
+ .addPositionalParam("x", Typed.typeLevelReference("String", Types.STRING))
+ .addNamedParam("y", Typed.typeLevelReference("Int", Types.INT))
+ .addStatement(Typed.expressionStatement(Typed.stringLiteral("hello")))
+ .build()
+ )
+ );
- var instructions = StackCompiler.compileNamespace(node, namespaceName);
+ var instructions = StackCompiler.compileNamespace(node);
assertThat(instructions, isSequence(
instanceOf(