Skip to content

[lldb] Add test to document alias tab completion behaviour #65760

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions lldb/test/API/functionalities/completion/TestCompletion.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,25 @@ def test_command_delete(self):
def test_command_unalias(self):
self.complete_from_to("command unalias ima", "command unalias image")

def test_command_aliases(self):
self.runCmd("command alias brkpt breakpoint")
# If there is an unambiguous completion from the built-in commands,
# we choose that.
self.complete_from_to("br", "breakpoint")
# Only if there is not, do we then look for an unambiguous completion
# from the user defined aliases.
self.complete_from_to("brk", "brkpt")

# Aliases are included when there's no exact match.
self.runCmd("command alias play breakpoint")
self.complete_from_to("pl", ["plugin", "platform", "play"])

# That list can also contain only aliases if there's no built-ins to
# match.
self.runCmd("command alias test_1 breakpoint")
self.runCmd("command alias test_2 breakpoint")
self.complete_from_to("test_", ["test_1", "test_2"])

def test_completion_description_commands(self):
"""Test descriptions of top-level command completions"""
self.check_completion_with_desc(
Expand Down