Skip to content

Commit

Permalink
Add extra test case
Browse files Browse the repository at this point in the history
  • Loading branch information
OdysseasKr committed Nov 14, 2024
1 parent 3beedd9 commit 15f1e49
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion tests/test_grammar.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,15 @@ def test_eval() -> None:

@pytest.mark.parametrize(
"valid_expression",
["a + 1", "a{100}", "b.c.d{*} AND TRUE", "-a", "-10", "-funCall(a,b)"],
[
"a + 1",
"a{100}",
"b.c.d{*} AND TRUE",
"-a",
"-10",
"-funCall(a,b)",
"a = b AND b <> z",
],
)
def test_expression(valid_expression: str) -> None:
assert expression.parseString(valid_expression, parseAll=True).as_list()
Expand Down Expand Up @@ -168,6 +176,7 @@ def test_var_def_section(input_str: str) -> None:
"IF a THEN\n callProc;\nELSE\n callAnotherProc;\nENDIF",
"IF a THEN\n callProc;\nELSEIF new_condition AND B THEN\n callNewProc;\nELSE\n callAnotherProc;\nENDIF",
"IF a THEN\n callProc;\n callProc2;\nELSEIF new_condition AND B THEN\n callNewProc;\n callProc2;\nELSE\n callAnotherProc;\nENDIF",
"IF a = b AND b <> 1 THEN\n var1 := 0;\nENDIF",
],
)
def test_valid_if_stmt(input_str: str) -> None:
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 15f1e49

Please sign in to comment.