aboutsummaryrefslogtreecommitdiff
path: root/lldb/packages/Python/lldbsuite/test/lldbtest.py
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lldbtest.py')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lldbtest.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index a4ff96e..63fadb5 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -2268,7 +2268,7 @@ class TestBase(Base, metaclass=LLDBTestCaseFactory):
completions, list(match_strings)[1:], "List of returned completion is wrong"
)
- def completions_contain(self, command, completions):
+ def completions_contain(self, command, completions, match=True):
"""Checks that the completions for the given command contain the given
list of completions."""
interp = self.dbg.GetCommandInterpreter()
@@ -2276,9 +2276,16 @@ class TestBase(Base, metaclass=LLDBTestCaseFactory):
interp.HandleCompletion(command, len(command), 0, -1, match_strings)
for completion in completions:
# match_strings is a 1-indexed list, so we have to slice...
- self.assertIn(
- completion, list(match_strings)[1:], "Couldn't find expected completion"
- )
+ if match:
+ self.assertIn(
+ completion,
+ list(match_strings)[1:],
+ "Couldn't find expected completion",
+ )
+ else:
+ self.assertNotIn(
+ completion, list(match_strings)[1:], "Found unexpected completion"
+ )
def filecheck(
self, command, check_file, filecheck_options="", expect_cmd_failure=False