changeset 26522:c6a57c46271e v8.2.3790

patch 8.2.3790: test for term_gettitle() fails in some environments Commit: https://github.com/vim/vim/commit/3bb79dc191a1dec14606b1b94b968a6808906700 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Dec 12 18:50:19 2021 +0000 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 https://github.com/vim/vim/issues/9334)
author Bram Moolenaar <Bram@vim.org>
date Sun, 12 Dec 2021 20:00:03 +0100
parents e487acf9c536
children 8f540a0b2c23
files src/testdir/test_terminal2.vim src/version.c
diffstat 2 files changed, 7 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/test_terminal2.vim
+++ b/src/testdir/test_terminal2.vim
@@ -521,15 +521,11 @@ func Test_term_gettitle()
   endif
 
   let term = term_start([GetVimProg(), '--clean', '-c', 'set noswapfile', '-c', 'set title'])
-  if has('autoservername')
-    call WaitForAssert({-> assert_match('^\[No Name\] - VIM\d\+$', term_gettitle(term)) })
-    call term_sendkeys(term, ":e Xfoo\r")
-    call WaitForAssert({-> assert_match('^Xfoo (.*[/\\]testdir) - VIM\d\+$', term_gettitle(term)) })
-  else
-    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
+  " When Vim is running as a server then the title ends in VIM{number}, thus
+  " optionally match a number after "VIM".
+  call WaitForAssert({-> assert_match('^\[No Name\] - VIM\d*$', term_gettitle(term)) })
+  call term_sendkeys(term, ":e Xfoo\r")
+  call WaitForAssert({-> assert_match('^Xfoo (.*[/\\]testdir) - VIM\d*$', term_gettitle(term)) })
 
   call term_sendkeys(term, ":set titlestring=foo\r")
   call WaitForAssert({-> assert_equal('foo', term_gettitle(term)) })
--- a/src/version.c
+++ b/src/version.c
@@ -754,6 +754,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    3790,
+/**/
     3789,
 /**/
     3788,