mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Correctly find contracts with other delimiters.
This commit is contained in:
parent
d134fda0c0
commit
5a939c4e1a
@ -7,23 +7,27 @@
|
|||||||
# scripts/isolate_tests.py test/libsolidity/*
|
# scripts/isolate_tests.py test/libsolidity/*
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
import re
|
||||||
|
|
||||||
|
|
||||||
def extract_cases(path):
|
def extract_cases(path):
|
||||||
lines = open(path).read().splitlines()
|
lines = open(path).read().splitlines()
|
||||||
|
|
||||||
inside = False
|
inside = False
|
||||||
|
delimiter = ''
|
||||||
tests = []
|
tests = []
|
||||||
|
|
||||||
for l in lines:
|
for l in lines:
|
||||||
if inside:
|
if inside:
|
||||||
if l.strip().endswith(')";'):
|
if l.strip().endswith(')' + delimiter + '";'):
|
||||||
inside = False
|
inside = False
|
||||||
else:
|
else:
|
||||||
tests[-1] += l + '\n'
|
tests[-1] += l + '\n'
|
||||||
else:
|
else:
|
||||||
if l.strip().endswith('R"('):
|
m = re.search(r'R"([^(]*)\($', l.strip())
|
||||||
|
if m:
|
||||||
inside = True
|
inside = True
|
||||||
|
delimiter = m.group(1)
|
||||||
tests += ['']
|
tests += ['']
|
||||||
|
|
||||||
return tests
|
return tests
|
||||||
|
Loading…
Reference in New Issue
Block a user