]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Don't use string_to_regexp twice in gdb.base/options.exp
authorTom de Vries <tdevries@suse.de>
Tue, 29 Apr 2025 15:14:46 +0000 (17:14 +0200)
committerTom de Vries <tdevries@suse.de>
Tue, 29 Apr 2025 15:14:46 +0000 (17:14 +0200)
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 <tom@tromey.com>
gdb/testsuite/gdb.base/options.exp

index f32d258a533c21133d39c53b1921e69c9e4adae3..7822e4a0baa7470d975ab36d132d1aa07c055bf2 100644 (file)
@@ -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
 }