aboutsummaryrefslogtreecommitdiffstats
path: root/test/util.py
blob: e1e3c3b43fc7f18008a3e5927e67146be99945be (plain)
1
2
3
4
5
6
7
import re

def flatten_result(result):
    return re.sub(r'[\s\n]+', ' ', result).strip()

def result_lines(result):
    return [x.strip() for x in re.sub(r' +', ' ', result).split('\n') if x.strip() != '']