-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from conftest import GDBSession | ||
|
||
|
||
def test_autosuggestion(gdb_session: GDBSession) -> None: | ||
gdb_session.send_literal("print 12\n") | ||
gdb_session.clear_pane() | ||
gdb_session.send_literal("print 34\n") | ||
gdb_session.clear_pane() | ||
|
||
# the autosuggestion should not be shown when no match | ||
gdb_session.send_literal("print x") | ||
assert b"(gdb) print x" == gdb_session.capture_pane() | ||
|
||
# make buffer to "print " | ||
gdb_session.send_key("BSpace") | ||
gdb_session.send_key("BSpace") | ||
gdb_session.send_literal(" ") | ||
# match "print 34" | ||
assert b"(gdb) print 34" == gdb_session.capture_pane() # TODO: there is no color | ||
# accept the suggestion | ||
gdb_session.send_key("Right") | ||
assert b"(gdb) print 34" == gdb_session.capture_pane() | ||
|
||
# make buffer to "print 1" | ||
gdb_session.send_key("BSpace") | ||
gdb_session.send_key("BSpace") | ||
gdb_session.send_literal("1") | ||
# match "print 12" | ||
assert b"(gdb) print 12" == gdb_session.capture_pane() # TODO: there is no color | ||
# accept the suggestion | ||
gdb_session.send_key("Right") | ||
assert b"(gdb) print 12" == gdb_session.capture_pane() |