mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-23 06:35:31 +00:00
Merge remote-tracking branch 'origin/pr/2207' into mbedtls-2.16
This commit is contained in:
commit
5677eab235
|
@ -75,11 +75,10 @@ class TestDataParser(object):
|
||||||
:param split_char: Split character
|
:param split_char: Split character
|
||||||
:return: List of splits
|
:return: List of splits
|
||||||
"""
|
"""
|
||||||
|
split_colon_fn = lambda x: re.sub(r'\\' + split_char, split_char, x)
|
||||||
if len(split_char) > 1:
|
if len(split_char) > 1:
|
||||||
raise ValueError('Expected split character. Found string!')
|
raise ValueError('Expected split character. Found string!')
|
||||||
out = re.sub(r'(\\.)|' + split_char,
|
out = map(split_colon_fn, re.split(r'(?<!\\)' + split_char, inp_str))
|
||||||
lambda m: m.group(1) or '\n', inp_str,
|
|
||||||
len(inp_str)).split('\n')
|
|
||||||
out = [x for x in out if x]
|
out = [x for x in out if x]
|
||||||
return out
|
return out
|
||||||
|
|
||||||
|
@ -112,8 +111,8 @@ class TestDataParser(object):
|
||||||
args = parts[1:]
|
args = parts[1:]
|
||||||
args_count = len(args)
|
args_count = len(args)
|
||||||
if args_count % 2 != 0:
|
if args_count % 2 != 0:
|
||||||
raise TestDataParserError("Number of test arguments should "
|
err_str_fmt = "Number of test arguments({}) should be even: {}"
|
||||||
"be even: %s" % line)
|
raise TestDataParserError(err_str_fmt.format(args_count, line))
|
||||||
grouped_args = [(args[i * 2], args[(i * 2) + 1])
|
grouped_args = [(args[i * 2], args[(i * 2) + 1])
|
||||||
for i in range(len(args)/2)]
|
for i in range(len(args)/2)]
|
||||||
self.tests.append((name, function_name, dependencies,
|
self.tests.append((name, function_name, dependencies,
|
||||||
|
|
Loading…
Reference in a new issue