From 5a939c4e1ac30e94892f4d4f2583443c38ca4113 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 15 Mar 2017 12:07:59 +0100 Subject: Correctly find contracts with other delimiters. --- scripts/isolate_tests.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts/isolate_tests.py') 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 -- cgit v1.2.3