diff options
author | Raphael Isemann <teemperor@gmail.com> | 2019-08-27 11:32:22 +0000 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2019-08-27 11:32:22 +0000 |
commit | 5edee822d2f80e23c9e465394bac6d9c31468406 (patch) | |
tree | ae5e04768f5a6f64bab9f0786945e12f0d330f2d /lldb/packages/Python/lldbsuite/test/iohandler/completion/TestIOHandlerCompletion.py | |
parent | b1f29cec251188a594148f7a53d063281d4ef155 (diff) | |
download | bcm5719-llvm-5edee822d2f80e23c9e465394bac6d9c31468406.tar.gz bcm5719-llvm-5edee822d2f80e23c9e465394bac6d9c31468406.zip |
[lldb] Allow partial completions to fix directory completion.
On the command line we usually insert a space after a completion to indicate that
the completion was successful. After the completion API refactoring, this also
happens with directories which essentially breaks file path completion (as
adding a space terminates the path and starts a new arg). This patch restores the old
behavior by again allowing partial completions. Also extends the iohandler
and SB API tests as the implementation for this is different in Editline
and SB API.
llvm-svn: 370043
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/iohandler/completion/TestIOHandlerCompletion.py')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/iohandler/completion/TestIOHandlerCompletion.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/iohandler/completion/TestIOHandlerCompletion.py b/lldb/packages/Python/lldbsuite/test/iohandler/completion/TestIOHandlerCompletion.py index 26805bfb07c..a6748c65619 100644 --- a/lldb/packages/Python/lldbsuite/test/iohandler/completion/TestIOHandlerCompletion.py +++ b/lldb/packages/Python/lldbsuite/test/iohandler/completion/TestIOHandlerCompletion.py @@ -2,6 +2,8 @@ Test completion in our IOHandlers. """ +import os + import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * @@ -48,6 +50,18 @@ class IOHandlerCompletionTest(TestBase): self.expect_string(prompt + "register") self.child.send("\n") + # Try tab completing directories and files. Also tests the partial + # completion where LLDB shouldn't print a space after the directory + # completion (as it didn't completed the full token). + dir_without_slashes = os.path.realpath(os.path.dirname(__file__)).rstrip("/") + self.child.send("file " + dir_without_slashes + "\t") + self.expect_string("iohandler/completion/") + # If we get a correct partial completion without a trailing space, then this + # should complete the current test file. + self.child.send("TestIOHandler\t") + self.expect_string("TestIOHandlerCompletion.py") + self.child.send("\n") + # Start tab completion and abort showing more commands with 'n'. self.child.send("\t") self.expect_string("More (Y/n/a)") |