]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Fix gdb.tui/main-2.exp for TERM=ansis
authorTom de Vries <tdevries@suse.de>
Fri, 8 Aug 2025 11:51:00 +0000 (13:51 +0200)
committerTom de Vries <tdevries@suse.de>
Fri, 8 Aug 2025 11:51:00 +0000 (13:51 +0200)
When running test-case gdb.tui/main-2.exp with TERM=ansis, I get:
...
screen line 6: 'B+><fg:black><intensity:bold>    21 <reverse:1><fg:default><intensity:normal>  return 0;<reverse:0>                                                         '
FAIL: gdb.tui/main-2.exp: highlighted line in middle of source window
...

The test tries to check the highlighting of the source line, but also gets the
part with the line number, which makes it more complicated to parse.

Fix this by getting just the part with the source line:
...
screen line 6: '<reverse:1>  return 0;<reverse:0>                                     \
                    '
...

Tested on x86_64-linux.

gdb/testsuite/gdb.tui/main-2.exp

index 71ad03b73fcec3d6d140fc170f7ed20392c7f084..14a7cb1e5ac4e30ea0e24dd51bbc97b7f4876698 100644 (file)
@@ -41,7 +41,7 @@ if {![Term::enter_tui]} {
 set line "  return 0;"
 set nr [gdb_get_line_number $line]
 
-set screen_line [Term::get_string_with_attrs 6 1 79]
+set screen_line [Term::get_string_with_attrs 6 11 79]
 verbose -log "screen line 6: '$screen_line'"
-gdb_assert { [regexp "$nr <reverse:1>$line<reverse:0>" $screen_line] } \
+gdb_assert { [regexp "<reverse:1>$line<reverse:0>" $screen_line] } \
     "highlighted line in middle of source window"