diff options
Diffstat (limited to 'src/test/java/org/shedlang/compiler/parser')
| -rw-r--r-- | src/test/java/org/shedlang/compiler/parser/ParserCallTests.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/test/java/org/shedlang/compiler/parser/ParserCallTests.java b/src/test/java/org/shedlang/compiler/parser/ParserCallTests.java new file mode 100644 index 00000000..a5c41cba --- /dev/null +++ b/src/test/java/org/shedlang/compiler/parser/ParserCallTests.java @@ -0,0 +1,29 @@ +package org.shedlang.compiler.parser; + +import org.junit.jupiter.api.Test; + +import static org.shedlang.compiler.ast.UntypedNodeMatchers.*; +import static org.shedlang.compiler.parser.ParserTesting.parseString; +import static org.zwobble.precisely.AssertThat.assertThat; +import static org.zwobble.precisely.Matchers.isSequence; + +public class ParserCallTests { + @Test + public void canParseCallWithoutEffectsWithNoArguments() { + var source = "f()"; + + var node = parseString(source, Parser::parseTopLevelExpression); + + assertThat( + node, + isUntypedCallNode() + .withReceiver(isUntypedReferenceNode("f")) + .withHasEffects(false) + .withArgs( + isUntypedArgsNode() + .withPositional(isSequence()) + .withNamed(isSequence()) + ) + ); + } +} |
