[gdb/tui] Delete line buffer when switching to singlekey
[binutils-gdb.git] / gdb / testsuite / gdb.tui / single-key-2.exp
blob5bde522ec2080dac82da588e24ea39fedc08faa1
1 # Copyright 2023 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 tuiterm_env
18 Term::clean_restart 24 80
19 if {![Term::enter_tui]} {
20 unsupported "TUI not supported"
21 return
24 set command_win { 0 16 80 8 }
26 # Send some chars as a partial command.
27 send_gdb "sun"
28 gdb_assert { [Term::wait_for_region_contents 0 16 80 8 "$gdb_prompt sun"] } \
29 "got sun"
31 # Enter single-key mode. That should clear the partial command.
32 send_gdb "\030s"
34 # Send "down command".
35 send_gdb "d"
37 # Regression test for PR tui/30522. Make sure we issue the command "down"
38 # rather than "sundown".
39 gdb_assert { [Term::wait_for_region_contents {*}$command_win "No stack\\."] } \
40 "down using single-key after partial command"