diff options
| author | Michael Williamson <mike@zwobble.org> | 2026-08-09 21:36:22 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2026-08-09 21:36:22 +0100 |
| commit | 412e1b2826382144e6d66cad3c9a5540f2785542 (patch) | |
| tree | e56ecd745eb4682c49ca91c717626d4052fda9d7 /src/test/java | |
| parent | 98962d6c17fd91be269e6c8a766977707422cbb4 (diff) | |
Make type params on native type node optional
Diffstat (limited to 'src/test/java')
2 files changed, 6 insertions, 6 deletions
diff --git a/src/test/java/org/zwobble/hobgoblin/compiler/ast/untyped/UntypedNativeTypeDefinitionNodeMatcher.java b/src/test/java/org/zwobble/hobgoblin/compiler/ast/untyped/UntypedNativeTypeDefinitionNodeMatcher.java index e1f02a0..3105dae 100644 --- a/src/test/java/org/zwobble/hobgoblin/compiler/ast/untyped/UntypedNativeTypeDefinitionNodeMatcher.java +++ b/src/test/java/org/zwobble/hobgoblin/compiler/ast/untyped/UntypedNativeTypeDefinitionNodeMatcher.java @@ -36,7 +36,7 @@ public final class UntypedNativeTypeDefinitionNodeMatcher implements org.zwobble return new org.zwobble.hobgoblin.compiler.ast.untyped.UntypedNativeTypeDefinitionNodeMatcher(submatchers); } - public org.zwobble.hobgoblin.compiler.ast.untyped.UntypedNativeTypeDefinitionNodeMatcher withTypeParams(org.zwobble.precisely.Matcher<? super java.util.List<org.zwobble.hobgoblin.compiler.ast.untyped.UntypedTypeParamNode>> typeParams) { + public org.zwobble.hobgoblin.compiler.ast.untyped.UntypedNativeTypeDefinitionNodeMatcher withTypeParams(org.zwobble.precisely.Matcher<? super java.util.Optional<java.util.List<org.zwobble.hobgoblin.compiler.ast.untyped.UntypedTypeParamNode>>> typeParams) { var submatchers = new java.util.ArrayList<org.zwobble.precisely.Matcher<? super org.zwobble.hobgoblin.compiler.ast.untyped.UntypedNativeTypeDefinitionNode>>(this.submatchers); submatchers.add(org.zwobble.precisely.Matchers.has("typeParams", org.zwobble.hobgoblin.compiler.ast.untyped.UntypedNativeTypeDefinitionNode::typeParams, typeParams)); return new org.zwobble.hobgoblin.compiler.ast.untyped.UntypedNativeTypeDefinitionNodeMatcher(submatchers); diff --git a/src/test/java/org/zwobble/hobgoblin/compiler/parser/ParserNativeTypeDefinitionTests.java b/src/test/java/org/zwobble/hobgoblin/compiler/parser/ParserNativeTypeDefinitionTests.java index ca0a71d..444b392 100644 --- a/src/test/java/org/zwobble/hobgoblin/compiler/parser/ParserNativeTypeDefinitionTests.java +++ b/src/test/java/org/zwobble/hobgoblin/compiler/parser/ParserNativeTypeDefinitionTests.java @@ -39,7 +39,7 @@ public class ParserNativeTypeDefinitionTests { ); assertThat(node, isUntypedNativeTypeDefinitionNode() - .withTypeParams(isSequence()) + .withTypeParams(isOptionalEmpty()) ); } @@ -55,9 +55,9 @@ public class ParserNativeTypeDefinitionTests { ); assertThat(node, isUntypedNativeTypeDefinitionNode() - .withTypeParams(isSequence( + .withTypeParams(isOptionalOf(isSequence( isUntypedTypeParamNode().withName(equalTo("TPoint")) - )) + ))) ); } @@ -73,10 +73,10 @@ public class ParserNativeTypeDefinitionTests { ); assertThat(node, isUntypedNativeTypeDefinitionNode() - .withTypeParams(isSequence( + .withTypeParams(isOptionalOf(isSequence( isUntypedTypeParamNode().withName(equalTo("K")), isUntypedTypeParamNode().withName(equalTo("V")) - )) + ))) ); } } |
