tools/extracttests.py: test code was not extracted properly for some tests (#5776)

This commit is contained in:
Daniel Marjamäki 2023-12-17 20:04:17 +01:00 committed by GitHub
parent 2932ab7592
commit 34fb24d5a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 6 deletions

View File

@ -94,8 +94,7 @@ class Extract:
start_code = None
disable = False
fin = open(filename, 'r')
for line in fin:
for line in open(filename, 'r'):
# testclass starts
res = re.match('class (' + name + ')', line)
if res is not None:
@ -137,6 +136,10 @@ class Extract:
if code is not None:
res = re.match('\\s+' + string, line)
if res is not None:
if line.find('",') > line.find('"'):
code = None
continue
code = code + res.group(1)
if res.group(1).find('"') > 0:
code = None
@ -159,10 +162,8 @@ class Extract:
'expected': expected}
self.nodes.append(node)
code = None
# close test file
fin.close()
elif re.match('\\s+[TOD_]*ASSERT', line) is not None:
code = None
def strtoxml(s):
"""Convert string to xml/html format"""