From: Tom de Vries Date: Tue, 29 Apr 2025 15:14:46 +0000 (+0200) Subject: [gdb/testsuite] Don't use string_to_regexp twice in gdb.base/options.exp X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a6af579207d45bcd92c5388f9d59030b4ef9beae;p=thirdparty%2Fbinutils-gdb.git [gdb/testsuite] Don't use string_to_regexp twice in gdb.base/options.exp In test-case gdb.base/options.exp, in proc test_completer_recognizes we have: ... set expected_re [string_to_regexp $input_line] test_gdb_complete_unique $input_line $expected_re ... However, the first thing we do in proc test_gdb_complete_unique is to apply string_to_regexp to the second argument: ... proc test_gdb_complete_unique { input_line complete_line {append_char " "} {max_completions false} {testname ""} } { set complete_line_re [string_to_regexp $complete_line] test_gdb_complete_unique_re \ $input_line \ $complete_line_re \ $append_char \ $max_completions\ $testname } ... This happens to not cause any FAILs at the moment, but this should be done only once. Fix this not using string_to_regexp in proc test_completer_recognizes. Tested on x86_64-linux. Approved-By: Tom Tromey --- diff --git a/gdb/testsuite/gdb.base/options.exp b/gdb/testsuite/gdb.base/options.exp index f32d258a533..7822e4a0baa 100644 --- a/gdb/testsuite/gdb.base/options.exp +++ b/gdb/testsuite/gdb.base/options.exp @@ -62,8 +62,7 @@ proc check_completion_result {expected test} { # just checking whether GDB recognizes the option and auto-appends a # space. proc test_completer_recognizes {res input_line} { - set expected_re [string_to_regexp $input_line] - test_gdb_complete_unique $input_line $expected_re + test_gdb_complete_unique $input_line $input_line check_completion_result $res $input_line }