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)) })