diff options
| author | Michael Williamson <mike@zwobble.org> | 2023-06-17 21:08:21 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2023-06-17 21:08:21 +0100 |
| commit | 8f03a9fb5d65c44762edd478d964935da5f2c85a (patch) | |
| tree | b386f1f3c9ab8de1eda01398df41a88863746bb5 /src/test/java/org | |
| parent | 825de654d0ba113a9df0d91e28613e6bbf8ede42 (diff) | |
Introduce FreeVariables collection type
Diffstat (limited to 'src/test/java/org')
| -rw-r--r-- | src/test/java/org/shedlang/compiler/backends/llvm/LlvmCompilerDefineFunctionTests.java | 7 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/stackir/InstructionSerializerTests.java | 4 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/test/java/org/shedlang/compiler/backends/llvm/LlvmCompilerDefineFunctionTests.java b/src/test/java/org/shedlang/compiler/backends/llvm/LlvmCompilerDefineFunctionTests.java index 31b695eb..f49d03cd 100644 --- a/src/test/java/org/shedlang/compiler/backends/llvm/LlvmCompilerDefineFunctionTests.java +++ b/src/test/java/org/shedlang/compiler/backends/llvm/LlvmCompilerDefineFunctionTests.java @@ -1,18 +1,17 @@ package org.shedlang.compiler.backends.llvm; import org.junit.jupiter.api.Test; +import org.shedlang.compiler.ast.typed.FreeVariables; import org.shedlang.compiler.backends.llvm.ir.LlvmIrSerializer; import org.shedlang.compiler.backends.llvm.ir.ast.LlvmIr; import org.shedlang.compiler.backends.llvm.ir.ast.operands.LlvmOperand; import org.shedlang.compiler.sources.Sources; import org.shedlang.compiler.stackir.instructions.DefineFunctionInstruction; import org.shedlang.compiler.stackir.instructions.Instructions; -import org.shedlang.compiler.util.P; import org.zwobble.precisely.Matcher; import java.util.List; import java.util.Map; -import java.util.Set; import static org.shedlang.compiler.backends.llvm.ir.ast.LlvmIrMatchers.isLlvmVariableLocal; import static org.shedlang.compiler.util.Iterables.forEachInterspersed; @@ -26,7 +25,7 @@ public class LlvmCompilerDefineFunctionTests { "f", List.of(), List.of(), - Set.of(), + FreeVariables.empty(), List.of( Instructions.pushUnit(), Instructions.return_() @@ -75,7 +74,7 @@ public class LlvmCompilerDefineFunctionTests { "f", List.of(), List.of(), - P.orderedSet("a", "b"), + FreeVariables.of("a", "b"), List.of( Instructions.pushUnit(), Instructions.return_() diff --git a/src/test/java/org/shedlang/compiler/stackir/InstructionSerializerTests.java b/src/test/java/org/shedlang/compiler/stackir/InstructionSerializerTests.java index 4c1cc6e2..14e71249 100644 --- a/src/test/java/org/shedlang/compiler/stackir/InstructionSerializerTests.java +++ b/src/test/java/org/shedlang/compiler/stackir/InstructionSerializerTests.java @@ -1,6 +1,7 @@ package org.shedlang.compiler.stackir; import org.junit.jupiter.api.Test; +import org.shedlang.compiler.ast.typed.FreeVariables; import org.shedlang.compiler.sources.Sources; import org.shedlang.compiler.stackir.instructions.DefineFunctionInstruction; import org.shedlang.compiler.stackir.instructions.Instruction; @@ -9,7 +10,6 @@ import org.shedlang.compiler.types.NamespaceName; import java.util.List; -import static org.shedlang.compiler.util.Sets.orderedSetOf; import static org.zwobble.precisely.AssertThat.assertThat; import static org.zwobble.precisely.Matchers.equalTo; @@ -30,7 +30,7 @@ public class InstructionSerializerTests { "f", List.of(Instructions.param("p1"), Instructions.param("p2")), List.of(Instructions.param("n1"), Instructions.param("n2")), - orderedSetOf("fv1", "fv2"), + FreeVariables.of("fv1", "fv2"), List.of( Instructions.pushBool(true), Instructions.pushBool(false) |
