]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
[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)
commita6af579207d45bcd92c5388f9d59030b4ef9beae
treecdf9493ed29599364460d863b2426327a26389b4
parentde546e403cbbac70bbe15ab2c289c01b1ce53fc9
[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 <tom@tromey.com>
gdb/testsuite/gdb.base/options.exp