[Lldb-commits] [lldb] r338179 - Add the actually calculated completions to COMPLETION_MSG

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Fri Jul 27 16:42:34 PDT 2018


Author: teemperor
Date: Fri Jul 27 16:42:34 2018
New Revision: 338179

URL: http://llvm.org/viewvc/llvm-project?rev=338179&view=rev
Log:
Add the actually calculated completions to COMPLETION_MSG

Summary: Otherwise this assertion message is not very useful to whoever is reading the log.

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D49947

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
    lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py?rev=338179&r1=338178&r2=338179&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py Fri Jul 27 16:42:34 2018
@@ -313,8 +313,8 @@ class CommandLineCompletionTestCase(Test
             if turn_off_re_match:
                 self.expect(
                     compare_string, msg=COMPLETION_MSG(
-                        str_input, p), exe=False, substrs=[p])
+                        str_input, p, match_strings), exe=False, substrs=[p])
             else:
                 self.expect(
                     compare_string, msg=COMPLETION_MSG(
-                        str_input, p), exe=False, patterns=[p])
+                        str_input, p, match_strings), exe=False, patterns=[p])

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=338179&r1=338178&r2=338179&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Fri Jul 27 16:42:34 2018
@@ -184,9 +184,10 @@ def CMD_MSG(str):
     return "Command '%s' returns successfully" % str
 
 
-def COMPLETION_MSG(str_before, str_after):
+def COMPLETION_MSG(str_before, str_after, completions):
     '''A generic message generator for the completion mechanism.'''
-    return "'%s' successfully completes to '%s'" % (str_before, str_after)
+    return ("'%s' successfully completes to '%s', but completions were:\n%s"
+           % (str_before, str_after, "\n".join(completions)))
 
 
 def EXP_MSG(str, actual, exe):




More information about the lldb-commits mailing list