aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2017-03-15 19:07:59 +0800
committerchriseth <c@ethdev.com>2017-03-15 19:07:59 +0800
commit5a939c4e1ac30e94892f4d4f2583443c38ca4113 (patch)
treef131678cc84074e2c9732db864caedee9299db10
parentd134fda0c05640992941087139316d2b8fb3f816 (diff)
downloaddexon-solidity-5a939c4e1ac30e94892f4d4f2583443c38ca4113.tar.gz
dexon-solidity-5a939c4e1ac30e94892f4d4f2583443c38ca4113.tar.zst
dexon-solidity-5a939c4e1ac30e94892f4d4f2583443c38ca4113.zip
Correctly find contracts with other delimiters.
-rwxr-xr-xscripts/isolate_tests.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/isolate_tests.py b/scripts/isolate_tests.py
index 91900aa6..9bb52f4c 100755
--- a/scripts/isolate_tests.py
+++ b/scripts/isolate_tests.py
@@ -7,23 +7,27 @@
# scripts/isolate_tests.py test/libsolidity/*
import sys
+import re
def extract_cases(path):
lines = open(path).read().splitlines()
inside = False
+ delimiter = ''
tests = []
for l in lines:
if inside:
- if l.strip().endswith(')";'):
+ if l.strip().endswith(')' + delimiter + '";'):
inside = False
else:
tests[-1] += l + '\n'
else:
- if l.strip().endswith('R"('):
+ m = re.search(r'R"([^(]*)\($', l.strip())
+ if m:
inside = True
+ delimiter = m.group(1)
tests += ['']
return tests