Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Loading