Skip to content

Commit

Permalink
Tests: test "let" fails to parse when body is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkKoz committed May 1, 2022
1 parent 6dce28f commit 618eb0b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/parser/test_let_and_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,17 @@ def test_let_multiple_bindings_and_forms_parses(program, body_program, bindings,
result = parse(program)

assert result == Program((Let(bindings, body),))


@pytest.mark.parametrize(["program", "form"], FORMS_WITH_SET_AND_BINDING)
def test_let_single_binding_missing_body_fails(program, form):
with pytest.raises(ValueError): # noqa: PT011 # TODO: Use custom exception type.
parse(f"(let ((aZ8__xe_2 {program})))")


@pytest.mark.parametrize(["program", "bindings"], MULTIPLE_LET)
def test_let_multiple_bindings_missing_body_fails(program, bindings):
program = program.replace("$body$", "")

with pytest.raises(ValueError): # noqa: PT011 # TODO: Use custom exception type.
parse(program)

0 comments on commit 618eb0b

Please sign in to comment.