Skip to content

Commit

Permalink
Create simple test
Browse files Browse the repository at this point in the history
  • Loading branch information
lebr0nli committed May 13, 2024
1 parent 70107fa commit a3f6239
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/test_gep.py
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()

0 comments on commit a3f6239

Please sign in to comment.