summaryrefslogtreecommitdiff
path: root/src/test/java/org/zwobble
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/org/zwobble')
-rw-r--r--src/test/java/org/zwobble/hobgoblin/compiler/analysis/ArbitraryValueAnalysisTests.java8
-rw-r--r--src/test/java/org/zwobble/hobgoblin/compiler/typechecker/TypeCheckerSubtypingTests.java10
-rw-r--r--src/test/java/org/zwobble/hobgoblin/compiler/typechecker/TypeCheckerSumDefinitionTests.java3
3 files changed, 14 insertions, 7 deletions
diff --git a/src/test/java/org/zwobble/hobgoblin/compiler/analysis/ArbitraryValueAnalysisTests.java b/src/test/java/org/zwobble/hobgoblin/compiler/analysis/ArbitraryValueAnalysisTests.java
index 30dbc7b..526f6bb 100644
--- a/src/test/java/org/zwobble/hobgoblin/compiler/analysis/ArbitraryValueAnalysisTests.java
+++ b/src/test/java/org/zwobble/hobgoblin/compiler/analysis/ArbitraryValueAnalysisTests.java
@@ -21,7 +21,7 @@ public class ArbitraryValueAnalysisTests {
public void whenTypeHasNoVariantsThenErrorIsThrown() {
var sumType = new SumType(NamespaceName.of(), "X");
var typesInfo = TypesInfoInMemory.empty();
- typesInfo.defineSumType(sumType, List.of(), List.of());
+ typesInfo.defineSumType(sumType, List.of(), List.of(), NullSource.INSTANCE);
var error = assertThrows(
SumTypeHasNoVariantsError.class,
@@ -41,7 +41,8 @@ public class ArbitraryValueAnalysisTests {
List.of(
new SumVariant(0, variantType, variantType)
),
- List.of()
+ List.of(),
+ NullSource.INSTANCE
);
typesInfo.defineStructType(variantType, Optional.of(List.of(
new Field("x", sumType, NullSource.INSTANCE)
@@ -67,7 +68,8 @@ public class ArbitraryValueAnalysisTests {
new SumVariant(0, recursiveVariantType, recursiveVariantType),
new SumVariant(1, nonRecursiveVariantType, nonRecursiveVariantType)
),
- List.of()
+ List.of(),
+ NullSource.INSTANCE
);
typesInfo.defineStructType(recursiveVariantType, Optional.of(List.of(
new Field("x", sumType, NullSource.INSTANCE)
diff --git a/src/test/java/org/zwobble/hobgoblin/compiler/typechecker/TypeCheckerSubtypingTests.java b/src/test/java/org/zwobble/hobgoblin/compiler/typechecker/TypeCheckerSubtypingTests.java
index 7080b81..f22bc3e 100644
--- a/src/test/java/org/zwobble/hobgoblin/compiler/typechecker/TypeCheckerSubtypingTests.java
+++ b/src/test/java/org/zwobble/hobgoblin/compiler/typechecker/TypeCheckerSubtypingTests.java
@@ -1,6 +1,7 @@
package org.zwobble.hobgoblin.compiler.typechecker;
import org.junit.jupiter.api.Test;
+import org.zwobble.hobgoblin.compiler.sources.NullSource;
import org.zwobble.hobgoblin.compiler.types.*;
import java.util.List;
@@ -42,7 +43,8 @@ public class TypeCheckerSubtypingTests {
new SumVariant(0, variantType1, variantType1),
new SumVariant(1, variantType2, variantType2)
),
- List.of()
+ List.of(),
+ NullSource.INSTANCE
);
var isSubtype = isSubtype(variantType1, sumType, typesInfo);
@@ -63,7 +65,8 @@ public class TypeCheckerSubtypingTests {
new SumVariant(0, variantType1, variantType1),
new SumVariant(1, variantType2, variantType2)
),
- List.of()
+ List.of(),
+ NullSource.INSTANCE
);
var otherSumType = new SumType(NamespaceName.of(), "Shape3D");
@@ -71,7 +74,8 @@ public class TypeCheckerSubtypingTests {
typesInfo.defineSumType(
otherSumType,
List.of(new SumVariant(0, otherVariantType, otherVariantType)),
- List.of()
+ List.of(),
+ NullSource.INSTANCE
);
var isSubtype = isSubtype(variantType1, otherSumType, typesInfo);
diff --git a/src/test/java/org/zwobble/hobgoblin/compiler/typechecker/TypeCheckerSumDefinitionTests.java b/src/test/java/org/zwobble/hobgoblin/compiler/typechecker/TypeCheckerSumDefinitionTests.java
index 96f2e5d..ef67cb5 100644
--- a/src/test/java/org/zwobble/hobgoblin/compiler/typechecker/TypeCheckerSumDefinitionTests.java
+++ b/src/test/java/org/zwobble/hobgoblin/compiler/typechecker/TypeCheckerSumDefinitionTests.java
@@ -322,7 +322,8 @@ public class TypeCheckerSumDefinitionTests {
namespaceContext.defineSumType(
sumType,
List.of(new SumVariant(0, variantType, variantType)),
- List.of(new Field("area", int32Type, NullSource.INSTANCE))
+ List.of(new Field("area", int32Type, NullSource.INSTANCE)),
+ NullSource.INSTANCE
);
assertThrows(