aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/shedlang/compiler/parser/ParserEqualsTests.java
blob: e2615d95c333c03d222e9c04eb0f0fc7878a32ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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;

public class ParserEqualsTests {
    @Test
    public void canParseEqualityOfTwoPrimaryExpressions() {
        var source = "1 == 2";

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

        assertThat(node, isUntypedEqualsNode(
            isUntypedIntLiteralNode(1),
            isUntypedIntLiteralNode(2)
        ));
    }
}