From 28d0c0c2c8e88d2b6599ee34c84eb58eed43a626 Mon Sep 17 00:00:00 2001 From: Dave Lee Date: Wed, 3 Aug 2022 22:22:40 -0600 Subject: [lldb] Tidy some regex in crashlog.py (NFC) A spiritual follow up to D131032. I noticed some regex could be simplified. This does some of the following: 1. Removes unused capture groups 2. Uses non-capturing `(?:...)` groups where grouping is needed but capturing isn't 3. Removes trailing `.*` 4. Uses `\d` over `[0-9]` 5. Uses raw strings 6. Uses `{N,}` to indicate N-or-more Also improves the call site of a `re.findall`. Differential Revision: https://reviews.llvm.org/D131305 --- lldb/test/Shell/ScriptInterpreter/Python/Crashlog/parser_text.test | 7 ------- 1 file changed, 7 deletions(-) (limited to 'lldb/test/Shell/ScriptInterpreter/Python') diff --git a/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/parser_text.test b/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/parser_text.test index 7251d85..af3f9ad 100644 --- a/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/parser_text.test +++ b/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/parser_text.test @@ -52,7 +52,6 @@ images = [ # CHECK: MyFramework Plus.dylib # CHECK: ({{.*}} # CHECK: 1.11 - MyFramework 1.11 -# CHECK: <{{.*}} # CHECK: 01234 # CHECK: /tmp/MyFramework Plus.dylib @@ -62,7 +61,6 @@ images = [ # CHECK: MyFramework-dev.dylib # CHECK: ({{.*}} # CHECK: 1.0.0svn - 1.0.0svn -# CHECK: <{{.*}} # CHECK: 01234 # CHECK: /MyFramework-dev.dylib @@ -73,7 +71,6 @@ images = [ # CHECK: ({{.*}} # CHECK: 400.9.4 # CHECK: None -# CHECK: None # CHECK: /usr/lib/libc++.1.dylib "0x1047b8000 - 0x10481ffff dyld arm64e /usr/lib/dyld" @@ -82,7 +79,6 @@ images = [ # CHECK: dyld # CHECK: {{.*}} # CHECK: arm64e -# CHECK: <{{.*}} # CHECK: cfa789d10da63f9a8996daf84ed9d04f # CHECK: /usr/lib/dyld ] @@ -101,9 +97,6 @@ frames = [ "2 MyApp Pro arm64 0x000000019b0db3a8 foo + 72", # CHECK: 2 # CHECK: MyApp Pro -# CHECK: a -# CHECK: arm64 -# CHECK: a # CHECK: 0x000000019b0db3a8 # CHECK: foo + 72 "3 He 0x1 0x000000019b0db3a8 foo + 72" -- cgit v1.1