Update copyright year range in all GDB files.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.tui / completion.exp
CommitLineData
b811d2c2 1# Copyright 2015-2020 Free Software Foundation, Inc.
1a4dd9dd
PA
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
16gdb_exit
17gdb_start
18
19if {[skip_tui_tests] || [target_info exists gdb,nointerrupts]} {
20 return
21}
22
23gdb_test_no_output "set max-completions unlimited"
24
584a564f
PA
25# TAB-complete INPUT_LINE, and expect EXPECTED_RE as completion match
26# output.
27proc test_tab_completion {input_line expected_re} {
28 global gdb_prompt
29
1a4dd9dd 30 set test "tab completion"
584a564f 31 send_gdb "$input_line\t\t\t"
1a4dd9dd 32 gdb_test_multiple "" "$test" {
584a564f
PA
33 -re "$expected_re\r\n$gdb_prompt " {
34 gdb_test_multiple "" "$test" {
71774bc9 35 -re "^$input_line $" {
584a564f
PA
36 pass "$test"
37 }
38 }
1a4dd9dd
PA
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
584a564f
PA
50with_test_prefix "completion of layout names" {
51 test_tab_completion "layout" "asm *next *prev *regs *split *src *"
52}
1a4dd9dd 53
584a564f
PA
54with_test_prefix "completion of focus command" {
55 test_tab_completion "focus" "cmd *next *prev *src *"
1a4dd9dd 56}
This page took 0.64837 seconds and 4 git commands to generate.