]> granicus.if.org Git - vim/commitdiff
patch 8.2.3790: test for term_gettitle() fails in some environments v8.2.3790
authorBram Moolenaar <Bram@vim.org>
Sun, 12 Dec 2021 18:50:19 +0000 (18:50 +0000)
committerBram Moolenaar <Bram@vim.org>
Sun, 12 Dec 2021 18:50:19 +0000 (18:50 +0000)
Problem:    Test for term_gettitle() fails in some environments.
Solution:   Make the digits after "VIM" optional. (Kenta Sato, closes #9334)

src/testdir/test_terminal2.vim
src/version.c

index 68f9ad8682b7bd80ad65376a316a7e612792f504..088f697ec6761723a84a16a4410a6b35540c462b 100644 (file)
@@ -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)) })
index ac574d530ce8d718c0115fce0d7236f1e6b4c4f7..ec9ac322bc835bef6a0c2f282a43b5ff8dc387b7 100644 (file)
@@ -753,6 +753,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3790,
 /**/
     3789,
 /**/