Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add tests for PEP 7 parsing and escaping call in condition
  • Loading branch information
markshannon committed Aug 27, 2024
commit 0284b3fc9cf6eb3de38d548f67ec7c87dcbb15f8
32 changes: 32 additions & 0 deletions Lib/test/test_generated_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,38 @@ def test_sync_sp(self):
"""
self.run_cases_test(input, output)


def test_pep7_condition(self):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe test the else branch as well?

input = """
inst(OP, (arg1 -- out)) {
if (arg1)
out = 0;
else {
out = 1;
}
}
"""
output = ""
with self.assertRaises(Exception):
self.run_cases_test(input, output)


def test_escapes_in_condition(self):
input = """
inst(OP, (arg1 -- out)) {
if (escaping_call(arg1)) {
out = 0;
}
else {
out = 1;
}
}
"""
output = ""
with self.assertRaises(Exception):
self.run_cases_test(input, output)


def test_error_if_plain(self):
input = """
inst(OP, (--)) {
Expand Down