Mercurial > vim
changeset 27257:68c33419fdc6 v8.2.4157
patch 8.2.4157: terminal test fails because Windows sets the title
Commit: https://github.com/vim/vim/commit/ae1bd87fe84bfb31379bc5da351bca56a3d3b571
Author: ichizok <gclient.gaap@gmail.com>
Date: Thu Jan 20 14:57:29 2022 +0000
patch 8.2.4157: terminal test fails because Windows sets the title
Problem: Terminal test fails because Windows sets the title.
Solution: Add the "vterm_title" testing override and use it in the test.
(Ozaki Kiichi, closes #9556)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 20 Jan 2022 16:00:07 +0100 |
parents | fc12cb6e29b7 |
children | 43d000669fe8 |
files | runtime/doc/testing.txt src/globals.h src/terminal.c src/testdir/test_terminal.vim src/testing.c src/version.c |
diffstat | 6 files changed, 11 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/runtime/doc/testing.txt +++ b/runtime/doc/testing.txt @@ -208,6 +208,8 @@ test_override({name}, {val}) *test_ov ui_delay time in msec to use in ui_delay(); overrules a wait time of up to 3 seconds for messages uptime overrules sysinfo.uptime + vterm_title setting the window title by a job running in a + terminal window ALL clear all overrides ({val} is not used) "starting" is to be used when a test should behave like
--- a/src/globals.h +++ b/src/globals.h @@ -1642,6 +1642,7 @@ EXTERN int nfa_fail_for_testing INIT(= EXTERN int no_query_mouse_for_testing INIT(= FALSE); EXTERN int ui_delay_for_testing INIT(= 0); EXTERN int reset_term_props_on_termresponse INIT(= FALSE); +EXTERN int disable_vterm_title_for_testing INIT(= FALSE); EXTERN long override_sysinfo_uptime INIT(= -1); EXTERN int override_autoload INIT(= FALSE);
--- a/src/terminal.c +++ b/src/terminal.c @@ -3088,6 +3088,8 @@ handle_settermprop( switch (prop) { case VTERM_PROP_TITLE: + if (disable_vterm_title_for_testing) + break; strval = vim_strnsave((char_u *)value->string.str, value->string.len); if (strval == NULL)
--- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -14,6 +14,7 @@ let s:python = PythonProg() let $PROMPT_COMMAND='' func Test_terminal_basic() + call test_override('vterm_title', 1) au TerminalOpen * let b:done = 'yes' let buf = Run_shell_in_terminal({}) @@ -37,6 +38,7 @@ func Test_terminal_basic() call assert_equal("", bufname(buf)) au! TerminalOpen + call test_override('ALL', 0) unlet g:job endfunc
--- a/src/testing.c +++ b/src/testing.c @@ -1053,6 +1053,8 @@ f_test_override(typval_T *argvars, typva ui_delay_for_testing = val; else if (STRCMP(name, (char_u *)"term_props") == 0) reset_term_props_on_termresponse = val; + else if (STRCMP(name, (char_u *)"vterm_title") == 0) + disable_vterm_title_for_testing = val; else if (STRCMP(name, (char_u *)"uptime") == 0) override_sysinfo_uptime = val; else if (STRCMP(name, (char_u *)"autoload") == 0)