1
0
forked from aniani/vim

patch 8.2.3790: test for term_gettitle() fails in some environments

Problem:    Test for term_gettitle() fails in some environments.
Solution:   Make the digits after "VIM" optional. (Kenta Sato, closes #9334)
This commit is contained in:
Bram Moolenaar
2021-12-12 18:50:19 +00:00
parent fa9a8e0fd1
commit 3bb79dc191
2 changed files with 7 additions and 9 deletions

View File

@@ -521,15 +521,11 @@ func Test_term_gettitle()
endif endif
let term = term_start([GetVimProg(), '--clean', '-c', 'set noswapfile', '-c', 'set title']) let term = term_start([GetVimProg(), '--clean', '-c', 'set noswapfile', '-c', 'set title'])
if has('autoservername') " When Vim is running as a server then the title ends in VIM{number}, thus
call WaitForAssert({-> assert_match('^\[No Name\] - VIM\d\+$', term_gettitle(term)) }) " optionally match a number after "VIM".
call term_sendkeys(term, ":e Xfoo\r") call WaitForAssert({-> assert_match('^\[No Name\] - VIM\d*$', term_gettitle(term)) })
call WaitForAssert({-> assert_match('^Xfoo (.*[/\\]testdir) - VIM\d\+$', term_gettitle(term)) }) call term_sendkeys(term, ":e Xfoo\r")
else call WaitForAssert({-> assert_match('^Xfoo (.*[/\\]testdir) - VIM\d*$', term_gettitle(term)) })
call WaitForAssert({-> assert_equal('[No Name] - VIM', term_gettitle(term)) })
call term_sendkeys(term, ":e Xfoo\r")
call WaitForAssert({-> assert_match('^Xfoo (.*[/\\]testdir) - VIM$', term_gettitle(term)) })
endif
call term_sendkeys(term, ":set titlestring=foo\r") call term_sendkeys(term, ":set titlestring=foo\r")
call WaitForAssert({-> assert_equal('foo', term_gettitle(term)) }) call WaitForAssert({-> assert_equal('foo', term_gettitle(term)) })

View File

@@ -753,6 +753,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
3790,
/**/ /**/
3789, 3789,
/**/ /**/