Skip to content

[lldb] Fix missing characters when autocompleting LLDB commands in REPL #1388

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
Jul 3, 2020
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
45 changes: 45 additions & 0 deletions lldb/test/API/lang/swift/completion/TestSwiftREPLCompletion.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,51 @@ def test_basic_completion(self):
self.child.expect_exact("Hasher")
self.child.sendline("")

self.quit()

# PExpect uses many timeouts internally and doesn't play well
# under ASAN on a loaded machine..
@skipIfAsan
@skipUnlessDarwin
def test_lldb_command_completion(self):

self.launch(extra_args=["--repl"], executable=None, dimensions=(100,500))

# Wait on the first prompt
self.child.expect_exact("1>")

# Try completing something already complete.
self.child.send(":b\t")
self.child.expect_exact(":b ")
self.child.sendline("")

# Try completing something that only has one result "vers" -> "version".
self.child.send(":vers\t")
self.child.expect_exact(":version")
self.child.sendline("")

# Try completing something that has multiple completions.
self.child.send(":\t")
self.child.expect_exact("Available completions:")
self.child.expect_exact(":help")
self.child.expect_exact("More (Y/n/a)")
self.child.send("n")
self.child.sendline("help")

# Try completing something with subcommands.
self.child.send(":breakpoi\t")
self.child.expect_exact(":breakpoint ")
self.child.send("\t")
self.child.expect_exact("Available completions:")
self.child.expect_exact("command")
self.child.send("comm\t")
self.child.expect_exact(":breakpoint command ")
self.child.send("li\t")
self.child.expect_exact(":breakpoint command list")
self.child.sendline("")

self.quit()

def setUpCommands(self):
return [] # REPL doesn't take any setup commands.

Expand Down