summaryrefslogtreecommitdiff
path: root/tiger-compiler/tests/python/tests/test_syntax.py
blob: 2c9edd239a138c43650db1d8423ce8380aa52f69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import pytest

from setup import Testsuite, run_tc


def run_tc_parse(file: str) -> int:
    return run_tc(file, "--parse")

class TestSyntax:
    @pytest.mark.parametrize("file", Testsuite.GOOD.value)
    def test_syntax_good(self, file: str):
        assert run_tc_parse(file) == 0

    @pytest.mark.parametrize("file", Testsuite.SYNTAX.value)
    def test_syntax_error(self, file: str):
        assert run_tc_parse(file) == 3