[Lldb-commits] [lldb] r238510 - Simplify regex in TestDataFormatterUnordered.py for better readability.

Chaoren Lin chaorenl at google.com
Thu May 28 14:52:07 PDT 2015


Author: chaoren
Date: Thu May 28 16:52:07 2015
New Revision: 238510

URL: http://llvm.org/viewvc/llvm-project?rev=238510&view=rev
Log:
Simplify regex in TestDataFormatterUnordered.py for better readability.

Summary:
Using `(match){3}` instead of `matchmatchmatch`.
This is an update to D10078.

Test Plan: no change in test behavior.

Reviewers: clayborg, sivachandra

Reviewed By: sivachandra

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D10094

Modified:
    lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py

Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py?rev=238510&r1=238509&r2=238510&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py Thu May 28 16:52:07 2015
@@ -61,12 +61,28 @@ class LibcxxUnorderedDataFormatterTestCa
 
         self.expect('image list', substrs = self.getLibcPlusPlusLibs())
 
-        self.look_for_content_and_continue("map", ['size=5 {', 'hello', 'world', 'this', 'is', 'me'])
-        self.look_for_content_and_continue("mmap", ['size=6 {', 'first = 3', 'second = "this"', 'first = 2', 'second = "hello"'])
-        self.look_for_content_and_continue("iset", ['size=5 {', '\[\d\] = 5', '\[\d\] = 3', '\[\d\] = 2'])
-        self.look_for_content_and_continue("sset", ['size=5 {', '\[\d\] = "is"', '\[\d\] = "world"', '\[\d\] = "hello"'])
-        self.look_for_content_and_continue("imset", ['size=6 {', '\[\d\] = 3(\\n|.)+\[\d\] = 3(\\n|.)+\[\d\] = 3', '\[\d\] = 2', '\[\d\] = 1'])
-        self.look_for_content_and_continue("smset", ['size=5 {', '\[\d\] = "is"(\\n|.)+\[\d\] = "is"', '\[\d\] = "world"(\\n|.)+\[\d\] = "world"'])
+        self.look_for_content_and_continue(
+            "map", ['size=5 {', 'hello', 'world', 'this', 'is', 'me'])
+
+        self.look_for_content_and_continue(
+            "mmap", ['size=6 {', 'first = 3', 'second = "this"',
+                                 'first = 2', 'second = "hello"'])
+
+        self.look_for_content_and_continue(
+            "iset", ['size=5 {', '\[\d\] = 5', '\[\d\] = 3', '\[\d\] = 2'])
+
+        self.look_for_content_and_continue(
+            "sset", ['size=5 {', '\[\d\] = "is"', '\[\d\] = "world"',
+                                 '\[\d\] = "hello"'])
+
+        self.look_for_content_and_continue(
+            "imset", ['size=6 {', '(\[\d\] = 3(\\n|.)+){3}',
+                                  '\[\d\] = 2', '\[\d\] = 1'])
+
+        self.look_for_content_and_continue(
+            "smset",
+            ['size=5 {', '(\[\d\] = "is"(\\n|.)+){2}',
+                         '(\[\d\] = "world"(\\n|.)+){2}'])
 
 if __name__ == '__main__':
     import atexit





More information about the lldb-commits mailing list