summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py7
-rw-r--r--lldb/packages/Python/lldbsuite/test/lldbtest.py10
2 files changed, 17 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py b/lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
index 2df341e572d..969a7b543e0 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
@@ -91,6 +91,13 @@ class CommandLineCompletionTestCase(TestBase):
'arm64'])
@skipIfFreeBSD # timing out on the FreeBSD buildbot
+ def test_ambiguous_long_opt(self):
+ self.completions_match('breakpoint modify --th',
+ ['--thread-id',
+ '--thread-index',
+ '--thread-name'])
+
+ @skipIfFreeBSD # timing out on the FreeBSD buildbot
def test_plugin_load(self):
self.complete_from_to('plugin load ', [])
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