test(tui_spec): unskip a few more tests on Windows (#38618)

This commit is contained in:
zeertzjq
2026-03-31 08:54:53 +08:00
committed by GitHub
parent dbc4800dda
commit bc272cc36f
2 changed files with 31 additions and 41 deletions

View File

@@ -214,13 +214,18 @@ end
--- Remove this function when that's fixed.
---
--- @param screen test.functional.ui.screen
--- @param s string
function M.screen_expect(screen, s)
if t.is_os('win') then
s = s:gsub(' *%} +%|\n', '{MATCH: *}}{MATCH: *}|\n')
s = s:gsub('%}%^ +%|\n', '{MATCH:[ ^]*}}{MATCH:[ ^]*}|\n')
function M.override_screen_expect_for_conpty(screen)
if not t.is_os('win') then
return
end
local orig_screen_expect = screen.expect
function screen.expect(self, expected, attr_ids, ...)
if type(expected) == 'string' then
expected = expected:gsub(' *%} +%|\n', '{MATCH: *}}{MATCH: *}|\n')
expected = expected:gsub('%}%^ +%|\n', '{MATCH:[ ^]*}}{MATCH:[ ^]*}|\n')
end
orig_screen_expect(self, expected, attr_ids, ...)
end
screen:expect(s)
end
--- Asserts that the exit code of chan eventually matches the expected exit code