summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/lldbtest.py
diff options
context:
space:
mode:
authorRaphael Isemann <teemperor@gmail.com>2019-08-28 10:17:23 +0000
committerRaphael Isemann <teemperor@gmail.com>2019-08-28 10:17:23 +0000
commitefb8b7b1ec48caef82f1326f0f81528933d83629 (patch)
tree5f4d0535de262d46425df6cb902cdd454f3b72e6 /lldb/packages/Python/lldbsuite/test/lldbtest.py
parent1c5b143c990ceca118eaa9966a40496046e0a2de (diff)
downloadbcm5719-llvm-efb8b7b1ec48caef82f1326f0f81528933d83629.tar.gz
bcm5719-llvm-efb8b7b1ec48caef82f1326f0f81528933d83629.zip
[lldb] Fix and test completion for ambiguous long options
The refactoring patch for the option completion broke the completion for ambiguous long options. As this feature was also untested (as testing ambiguous options with the current test methods is impossible), I just noticed now. This patch restores the old behavior and adds a test for this feature. llvm-svn: 370185
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lldbtest.py')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lldbtest.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index 9d38909d679..6c00350167d 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -2194,6 +2194,16 @@ class TestBase(Base):
compare_string, msg=COMPLETION_MSG(
str_input, p, match_strings), exe=False, patterns=[p])
+ def completions_match(self, command, completions):
+ """Checks that the completions for the given command are equal to the
+ given list of completions"""
+ interp = self.dbg.GetCommandInterpreter()
+ match_strings = lldb.SBStringList()
+ interp.HandleCompletion(command, len(command), 0, -1, match_strings)
+ # match_strings is a 1-indexed list, so we have to slice...
+ self.assertItemsEqual(completions, list(match_strings)[1:],
+ "List of returned completion is wrong")
+
def filecheck(
self,
command,
OpenPOWER on IntegriCloud