Skip to content

Commit 52fd0ee

Browse files
authored
Merge pull request #1421 from poya/port/bug/SR-12867
Cherry-pick "[lldb] Fix missing characters when autocompleting LLDB commands in REPL" to swift/master
2 parents bece789 + 1caa24e commit 52fd0ee

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

lldb/test/API/lang/swift/completion/TestSwiftREPLCompletion.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,51 @@ def test_basic_completion(self):
3535
self.child.expect_exact("Hasher")
3636
self.child.sendline("")
3737

38+
self.quit()
39+
40+
# PExpect uses many timeouts internally and doesn't play well
41+
# under ASAN on a loaded machine..
42+
@skipIfAsan
43+
@skipUnlessDarwin
44+
def test_lldb_command_completion(self):
45+
46+
self.launch(extra_args=["--repl"], executable=None, dimensions=(100,500))
47+
48+
# Wait on the first prompt
49+
self.child.expect_exact("1>")
50+
51+
# Try completing something already complete.
52+
self.child.send(":b\t")
53+
self.child.expect_exact(":b ")
54+
self.child.sendline("")
55+
56+
# Try completing something that only has one result "vers" -> "version".
57+
self.child.send(":vers\t")
58+
self.child.expect_exact(":version")
59+
self.child.sendline("")
60+
61+
# Try completing something that has multiple completions.
62+
self.child.send(":\t")
63+
self.child.expect_exact("Available completions:")
64+
self.child.expect_exact(":help")
65+
self.child.expect_exact("More (Y/n/a)")
66+
self.child.send("n")
67+
self.child.sendline("help")
68+
69+
# Try completing something with subcommands.
70+
self.child.send(":breakpoi\t")
71+
self.child.expect_exact(":breakpoint ")
72+
self.child.send("\t")
73+
self.child.expect_exact("Available completions:")
74+
self.child.expect_exact("command")
75+
self.child.send("comm\t")
76+
self.child.expect_exact(":breakpoint command ")
77+
self.child.send("li\t")
78+
self.child.expect_exact(":breakpoint command list")
79+
self.child.sendline("")
80+
81+
self.quit()
82+
3883
def setUpCommands(self):
3984
return [] # REPL doesn't take any setup commands.
4085

0 commit comments

Comments
 (0)