[Lldb-commits] [lldb] r148600 - /lldb/trunk/test/functionalities/completion/TestCompletion.py

Johnny Chen johnny.chen at apple.com
Fri Jan 20 15:34:35 PST 2012


Author: johnny
Date: Fri Jan 20 17:34:35 2012
New Revision: 148600

URL: http://llvm.org/viewvc/llvm-project?rev=148600&view=rev
Log:
A little bit of cleanup to make the code more understandable.

Modified:
    lldb/trunk/test/functionalities/completion/TestCompletion.py

Modified: lldb/trunk/test/functionalities/completion/TestCompletion.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/completion/TestCompletion.py?rev=148600&r1=148599&r2=148600&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/completion/TestCompletion.py (original)
+++ lldb/trunk/test/functionalities/completion/TestCompletion.py Fri Jan 20 17:34:35 2012
@@ -62,8 +62,8 @@
                                'target.process.thread.step-avoid-regexp',
                                'target.process.thread.trace-thread'])
 
-    def complete_from_to(self, str_before, patterns):
-        """Test the completion mechanism completes str_before to pattern, where
+    def complete_from_to(self, str_input, patterns):
+        """Test the completion mechanism completes str_input to pattern, where
         patterns could be a pattern-string or a list of pattern-strings"""
         prompt = "(lldb) "
         add_prompt = "Enter your stop hook command(s).  Type 'DONE' to end.\r\n> "
@@ -78,11 +78,10 @@
                 child.logfile_send = f_send
                 child.logfile_read = f_read
 
-                # Test that str_before completes to str_after.
                 child.expect_exact(prompt)
                 child.setecho(True)
-                child.send("%s\t" % str_before)
-                #child.expect_exact("%s\t" % str_after)
+                # Sends str_input and a Tab to invoke the completion machinery.
+                child.send("%s\t" % str_input)
                 child.sendline('')
                 child.expect_exact(prompt)
 
@@ -100,9 +99,10 @@
             if type(patterns) is not types.ListType:
                 patterns = [patterns]
 
+            # Test that str_input completes to our patterns.
             # If each pattern matches from_child, the completion mechanism works!
             for p in patterns:
-                self.expect(from_child, msg=COMPLETIOND_MSG(str_before, p), exe=False,
+                self.expect(from_child, msg=COMPLETIOND_MSG(str_input, p), exe=False,
                     patterns = [p])
 
         child.logfile_send = None





More information about the lldb-commits mailing list