Skip to content

Commit

Permalink
Fix tests (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdbrnowski authored Dec 16, 2024
1 parent 4d6bc4e commit 1d3f597
Show file tree
Hide file tree
Showing 15 changed files with 20 additions and 3 deletions.
19 changes: 18 additions & 1 deletion test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_ast(n: int):
],
)
def test_sem_errors(name: str, line_numbers: list[int], additional: str):
result = runner.invoke(app, ["sem", f"tests/semantic/input_{name}.txt"])
result = runner.invoke(app, ["sem", f"tests/semantic/{name}.txt"])
assert result.exit_code == 0
for ln in line_numbers:
assert f"line {ln}" in result.stdout
Expand Down Expand Up @@ -115,3 +115,20 @@ def test_interpreter(name: str, output: str):
def test_interpreter_return():
result = runner.invoke(app, ["run", "tests/interpreter/return.txt"])
assert result.exit_code == 1


@pytest.mark.parametrize(
"name",
[
"parser/input_1.txt",
"parser/input_2.txt",
"ast/input_1.txt",
"ast/input_2.txt",
"ast/input_3.txt",
],
)
def test_all_on_previous_tests(
name: str,
): # run interpreter on parser tests and AST tests
result = runner.invoke(app, ["run", f"tests/{name}"])
assert result.exit_code == 0
4 changes: 2 additions & 2 deletions tests/parser/input_1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ string_1 = "#Hello!";

print H';

a = 1;
b = 2;
a = 1.0;
b = 2.0;

a += b;
a /= b;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 1d3f597

Please sign in to comment.