Skip to content

Commit 618eb0b

Browse files
committed
Tests: test "let" fails to parse when body is missing
1 parent 6dce28f commit 618eb0b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/parser/test_let_and_set.py

+14
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,17 @@ def test_let_multiple_bindings_and_forms_parses(program, body_program, bindings,
122122
result = parse(program)
123123

124124
assert result == Program((Let(bindings, body),))
125+
126+
127+
@pytest.mark.parametrize(["program", "form"], FORMS_WITH_SET_AND_BINDING)
128+
def test_let_single_binding_missing_body_fails(program, form):
129+
with pytest.raises(ValueError): # noqa: PT011 # TODO: Use custom exception type.
130+
parse(f"(let ((aZ8__xe_2 {program})))")
131+
132+
133+
@pytest.mark.parametrize(["program", "bindings"], MULTIPLE_LET)
134+
def test_let_multiple_bindings_missing_body_fails(program, bindings):
135+
program = program.replace("$body$", "")
136+
137+
with pytest.raises(ValueError): # noqa: PT011 # TODO: Use custom exception type.
138+
parse(program)

0 commit comments

Comments
 (0)