]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.tui/completion.exp
Update copyright year range in all GDB files.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.tui / completion.exp
1 # Copyright 2015-2019 Free Software Foundation, Inc.
2
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.
7 #
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.
12 #
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/>.
15
16 gdb_exit
17 gdb_start
18
19 if {[skip_tui_tests] || [target_info exists gdb,nointerrupts]} {
20 return
21 }
22
23 gdb_test_no_output "set max-completions unlimited"
24
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
29
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 }
48 }
49
50 with_test_prefix "completion of layout names" {
51 test_tab_completion "layout" "asm *next *prev *regs *split *src *"
52 }
53
54 with_test_prefix "completion of focus command" {
55 test_tab_completion "focus" "cmd *next *prev *src *"
56 }