gdb: Fix scrolling in TUI
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.tui / basic.exp
index c3a3fdd4f5e45490b802ce94725e1df2dbd35a51..be822f8a9151baa0fa228c7914b0643083cb6108 100644 (file)
@@ -35,6 +35,19 @@ gdb_assert {![string match "No Source Available" $text]} \
 Term::command "list main"
 Term::check_contents "list main" "21 *return 0"
 
+# Get the first source line.
+set line [Term::get_line 1]
+# Send an up arrow.
+send_gdb "\033\[A"
+# Wait for a redraw and check that the first line changed.
+if {[Term::wait_for [string_to_regexp $line]] \
+       && [Term::get_line 1] != $line\
+       && [Term::get_line 2] == $line} {
+    pass "scroll up"
+} else {
+    fail "scroll up"
+}
+
 Term::check_box "source box" 0 0 80 15
 
 Term::command "layout asm"
This page took 0.024558 seconds and 4 git commands to generate.