From 9f84acbe62f7158e5158bdb1d4f02f5520d550d7 Mon Sep 17 00:00:00 2001 From: ultrayay Date: Thu, 30 Jul 2020 10:53:54 +0800 Subject: [PATCH] fix issue #I1PF0T --- test/maple_test/compare.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/maple_test/compare.py b/test/maple_test/compare.py index 3dfbe37350..c28b8cccc8 100644 --- a/test/maple_test/compare.py +++ b/test/maple_test/compare.py @@ -218,7 +218,7 @@ def end_match(content, line_map, pattern, start=0, match_func=regex_match): def full_match(content, line_map, pattern, start=0, match_func=regex_match): line_num = text_index_to_line_num(line_map, start) - pattern = pattern.encode("utf-8").decode("unicode_escape") + pattern = re.sub(r'([^\u0100-\uffff]+)', lambda x:(x.group(1) + r' ').encode("utf-8").decode("unicode_escape")[:-1], pattern) if content != pattern: return False, start return True, line_map[line_num] + 1 @@ -226,7 +226,7 @@ def full_match(content, line_map, pattern, start=0, match_func=regex_match): def in_match(content, line_map, pattern, start=0, match_func=regex_match): line_num = text_index_to_line_num(line_map, start) - pattern = pattern.encode("utf-8").decode("unicode_escape") + pattern = re.sub(r'([^\u0100-\uffff]+)', lambda x:(x.group(1) + r' ').encode("utf-8").decode("unicode_escape")[:-1], pattern) if content.find(pattern) == -1: return False, start return True, line_map[line_num] + 1 -- Gitee