aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/shedlang/compiler/parser/ParserTupleTests.java
blob: 15ac079a6891f04cf9f004d17449b7acbeac6c37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package org.shedlang.compiler.parser;

import org.junit.jupiter.api.Test;

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.isSequence;

public class ParserTupleTests {
    @Test
    public void canParseTuple() {
        var source = "#(false, 1, 2)";

        var node = parseString(source, Parser::parseTopLevelExpression);

        assertThat(node, isUntypedTupleNode(isSequence(
            isUntypedBoolLiteralNode(false),
            isUntypedIntLiteralNode(1),
            isUntypedIntLiteralNode(2)
        )));
    }
}