mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
gh-109287: fix overrides in cases generator (#110419)
This commit is contained in:
parent
bb057b3370
commit
3c0f65ebce
4 changed files with 37 additions and 31 deletions
|
|
@ -598,6 +598,41 @@ class TestGeneratedCases(unittest.TestCase):
|
|||
"""
|
||||
self.run_cases_test(input, output)
|
||||
|
||||
def test_override_inst(self):
|
||||
input = """
|
||||
inst(OP, (--)) {
|
||||
spam();
|
||||
}
|
||||
override inst(OP, (--)) {
|
||||
ham();
|
||||
}
|
||||
"""
|
||||
output = """
|
||||
TARGET(OP) {
|
||||
ham();
|
||||
DISPATCH();
|
||||
}
|
||||
"""
|
||||
self.run_cases_test(input, output)
|
||||
|
||||
def test_override_op(self):
|
||||
input = """
|
||||
op(OP, (--)) {
|
||||
spam();
|
||||
}
|
||||
macro(M) = OP;
|
||||
override op(OP, (--)) {
|
||||
ham();
|
||||
}
|
||||
"""
|
||||
output = """
|
||||
TARGET(M) {
|
||||
ham();
|
||||
DISPATCH();
|
||||
}
|
||||
"""
|
||||
self.run_cases_test(input, output)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue