diff options
| author | Michael Williamson <mike@zwobble.org> | 2023-11-05 20:14:26 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2023-11-05 20:14:26 +0000 |
| commit | dee7b5195105812c776f5c3fd1814ad25ce4e358 (patch) | |
| tree | 55cb29428b6f4cfdaf414350d53a97960f35a217 /src/test/java/org/shedlang/compiler/config | |
| parent | f3d28bc5d05eea6d8ed9db603682631290f8da2c (diff) | |
Add builder for NamespaceTypeInfo
Diffstat (limited to 'src/test/java/org/shedlang/compiler/config')
| -rw-r--r-- | src/test/java/org/shedlang/compiler/config/ConfigCheckerTests.java | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/test/java/org/shedlang/compiler/config/ConfigCheckerTests.java b/src/test/java/org/shedlang/compiler/config/ConfigCheckerTests.java index 404e57e6..3c53df73 100644 --- a/src/test/java/org/shedlang/compiler/config/ConfigCheckerTests.java +++ b/src/test/java/org/shedlang/compiler/config/ConfigCheckerTests.java @@ -4,11 +4,9 @@ import org.junit.jupiter.api.Test; import org.shedlang.compiler.config.errors.ConfigError; import org.shedlang.compiler.typechecker.TypeInfos; import org.shedlang.compiler.types.*; -import org.shedlang.compiler.util.P; import java.io.IOException; import java.util.List; -import java.util.Map; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.zwobble.precisely.AssertThat.assertThat; @@ -21,12 +19,12 @@ public class ConfigCheckerTests { var typeInfos = TypeInfos.EMPTY .addNamespaceTypeInfo( NamespaceName.of("Main"), - NamespaceTypeInfo.fromFields(P.orderedMap( - Map.entry( + NamespaceTypeInfo.builder() + .addField( "main", new FunctionType(List.of(), List.of(), Effects.IO, Types.UNIT) ) - )) + .build() ); ConfigChecker.configCheckBin(binConfig, typeInfos); @@ -51,12 +49,12 @@ public class ConfigCheckerTests { var typeInfos = TypeInfos.EMPTY .addNamespaceTypeInfo( NamespaceName.of("Main"), - NamespaceTypeInfo.fromFields(P.orderedMap( - Map.entry( + NamespaceTypeInfo.builder() + .addField( "main2", new FunctionType(List.of(), List.of(), Effects.IO, Types.UNIT) ) - )) + .build() ); var error = assertThrows( @@ -73,12 +71,12 @@ public class ConfigCheckerTests { var typeInfos = TypeInfos.EMPTY .addNamespaceTypeInfo( NamespaceName.of("Main"), - NamespaceTypeInfo.fromFields(P.orderedMap( - Map.entry( + NamespaceTypeInfo.builder() + .addField( "main", new FunctionType(List.of(), List.of(), Effects.IO, Types.STRING) ) - )) + .build() ); var error = assertThrows( |
