diff options
author | Raphael Isemann <teemperor@gmail.com> | 2019-08-28 10:17:23 +0000 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2019-08-28 10:17:23 +0000 |
commit | efb8b7b1ec48caef82f1326f0f81528933d83629 (patch) | |
tree | 5f4d0535de262d46425df6cb902cdd454f3b72e6 /lldb/packages/Python/lldbsuite/test/lldbtest.py | |
parent | 1c5b143c990ceca118eaa9966a40496046e0a2de (diff) | |
download | bcm5719-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.py | 10 |
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, |