diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 450ca3574f..1a33fc2652 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-12-13 Pedro Alves + + * lib/completion-support.exp (test_gdb_complete_tab_multiple): + Tighten regexp by matching with an anchor. + 2017-12-13 Pedro Alves * gdb.cp/cpcompletion.exp: Load completion-support.exp. diff --git a/gdb/testsuite/lib/completion-support.exp b/gdb/testsuite/lib/completion-support.exp index fe5b16a85b..bebf90e117 100644 --- a/gdb/testsuite/lib/completion-support.exp +++ b/gdb/testsuite/lib/completion-support.exp @@ -139,9 +139,12 @@ proc test_gdb_complete_tab_multiple { input_line add_completed_line \ # extra tab to show the matches list. if {$add_completed_line != ""} { send_gdb "\t" + set maybe_bell ${completion::bell_re} + } else { + set maybe_bell "" } gdb_test_multiple "" "$test (second tab)" { - -re "$expected_re\r\n$gdb_prompt $input_line_re$add_completed_line_re$" { + -re "^${maybe_bell}\r\n$expected_re\r\n$gdb_prompt $input_line_re$add_completed_line_re$" { pass "$test" } }