Update copyright year range in all GDB files.
[binutils-gdb.git] / gdb / testsuite / gdb.tui / completion.exp
blob3ee87ea9d3a372de2a077b564d960bc016fd3b6d
1 # Copyright 2015-2020 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 gdb_exit
17 gdb_start
19 if {[skip_tui_tests] || [target_info exists gdb,nointerrupts]} {
20     return
23 gdb_test_no_output "set max-completions unlimited"
25 # TAB-complete INPUT_LINE, and expect EXPECTED_RE as completion match
26 # output.
27 proc test_tab_completion {input_line expected_re} {
28     global gdb_prompt
30     set test "tab completion"
31     send_gdb "$input_line\t\t\t"
32     gdb_test_multiple "" "$test" {
33         -re "$expected_re\r\n$gdb_prompt " {
34             gdb_test_multiple "" "$test" {
35                 -re "^$input_line $" {
36                     pass "$test"
37                 }
38             }
39         }
40     }
41     send_gdb "\003"
42     set test "quit command input"
43     gdb_test_multiple "" "$test" {
44         -re "$gdb_prompt $" {
45             pass "$test"
46         }
47     }
50 with_test_prefix "completion of layout names" {
51     test_tab_completion "layout" "asm *next *prev *regs *split *src *"
54 with_test_prefix "completion of focus command" {
55     test_tab_completion "focus" "cmd *next *prev *src *"