summaryrefslogtreecommitdiff
path: root/testsuite/driver/testlib.py
diff options
context:
space:
mode:
authorAndreas Klebinger <klebinger.andreas@gmx.at>2021-11-22 13:39:46 +0100
committerAndreas Klebinger <klebinger.andreas@gmx.at>2021-11-22 13:40:14 +0100
commit01806a0185b71ee1d8e5a42314c699d7dbcd35b0 (patch)
tree02b6c6d32aeade868be452f42f0a8940858aeb7f /testsuite/driver/testlib.py
parent6390afb8437011e128b334655b275211de7824ce (diff)
downloadhaskell-wip/andreask/improve_sink.tar.gz
Don't include types in test outputwip/andreask/improve_sink
Diffstat (limited to 'testsuite/driver/testlib.py')
-rw-r--r--testsuite/driver/testlib.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index d4c8fc38f7..667d743e0b 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ -800,20 +800,20 @@ def check_errmsg(needle):
return "%s not contained in -ddump-simpl\n" % needle
return normalise_errmsg_fun(norm)
-# grep_errmsg(regex,[match_only])
-# If match_only = True we only check the part of the error
+# grep_errmsg(regex,[groups])
+# If groups are given, return only the matched groups
# that matches the regex.
-def grep_errmsg(needle:str, match_only = False):
+def grep_errmsg(needle:str, groups = None):
def get_match(str:str):
m = re.search(needle,str)
if m:
- return m.group(0)
+ return "".join([m.group(g) for g in groups if m.group(g) is not None])
else:
return None
def norm(str) -> str:
- if not match_only:
+ if groups == None:
return "".join( filter(lambda l: re.search(needle,l),
str.splitlines(True)))
else: