From df6ec9c9606184b472fc3d7278e2a50fb32c1479 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Tue, 26 Dec 2023 11:25:10 +0000 Subject: Parse absent type-level args --- .../org/shedlang/compiler/parser/ParserCallTests.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/test/java/org/shedlang/compiler/parser') diff --git a/src/test/java/org/shedlang/compiler/parser/ParserCallTests.java b/src/test/java/org/shedlang/compiler/parser/ParserCallTests.java index ca217824..3b2bcc50 100644 --- a/src/test/java/org/shedlang/compiler/parser/ParserCallTests.java +++ b/src/test/java/org/shedlang/compiler/parser/ParserCallTests.java @@ -7,6 +7,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.shedlang.compiler.ast.untyped.UntypedNodeMatchers.*; import static org.shedlang.compiler.parser.ParserTesting.parseString; import static org.zwobble.precisely.AssertThat.assertThat; +import static org.zwobble.precisely.Matchers.isOptionalEmpty; import static org.zwobble.precisely.Matchers.isSequence; public class ParserCallTests { @@ -201,4 +202,19 @@ public class ParserCallTests { ) ); } + + // == Type-level args == + + @Test + public void canParseCallWithNoTypeLevelArgs() { + var source = "f()"; + + var node = parseString(source, Parser::parseTopLevelExpression); + + assertThat( + node, + isUntypedCallNode() + .withTypeLevelArgs(isOptionalEmpty()) + ); + } } -- cgit v1.2.3