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
38 changes: 38 additions & 0 deletions Lib/test/test_generated_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,44 @@ def test_push_then_error(self):
"""
self.run_cases_test(input, output)

def test_scalar_array_inconsistency(self):

input = """
op(FIRST, ( -- a)) {
a = 1;
}

op(SECOND, (a[1] -- b)) {
b = 1;
}

macro(TEST) = FIRST + SECOND;
"""

output = """
"""
with self.assertRaises(SyntaxError):
self.run_cases_test(input, output)

def test_array_size_inconsistency(self):

input = """
op(FIRST, ( -- a[2])) {
a[0] = 1;
}

op(SECOND, (a[1] -- b)) {
b = 1;
}

macro(TEST) = FIRST + SECOND;
"""

output = """
"""
with self.assertRaises(SyntaxError):
self.run_cases_test(input, output)


class TestGeneratedAbstractCases(unittest.TestCase):
def setUp(self) -> None:
Expand Down
143 changes: 67 additions & 76 deletions Python/bytecodes.c

Large diffs are not rendered by default.

Loading
Loading