aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_generated_cases.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_generated_cases.py')
-rw-r--r--Lib/test/test_generated_cases.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/Lib/test/test_generated_cases.py b/Lib/test/test_generated_cases.py
index 7f821810aea..5d20e3c30bc 100644
--- a/Lib/test/test_generated_cases.py
+++ b/Lib/test/test_generated_cases.py
@@ -1110,6 +1110,44 @@ class TestGeneratedCases(unittest.TestCase):
"""
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: