oldtests: Test_undofile() passes

Set undodir to Vim's default value.
Fix pathsep of expected undofile path for Windows.
Comment out invalid test case for Neovim.
This commit is contained in:
Jan Edmund Lazo 2018-08-09 19:30:48 -04:00
parent 1c1722105c
commit 09c2184660
2 changed files with 5 additions and 3 deletions

View File

@ -9,6 +9,7 @@ let s:did_load = 1
" Align Nvim defaults to Vim.
set sidescroll=0
set directory^=.
set undodir^=.
set backspace=
set nohidden smarttab noautoindent noautoread complete-=i noruler noshowcmd
set listchars=eol:$

View File

@ -375,9 +375,10 @@ funct Test_undofile()
" Replace windows drive such as C:... into C%...
let cwd = substitute(cwd, '^\([A-Z]\):', '\1%', 'g')
endif
let cwd = substitute(cwd . '/Xundofoo', '/', '%', 'g')
let pathsep = has('win32') ? '\' : '/'
let cwd = substitute(cwd . pathsep . 'Xundofoo', pathsep, '%', 'g')
if has('persistent_undo')
call assert_equal('Xundodir/' . cwd, undofile('Xundofoo'))
call assert_equal('Xundodir' . pathsep . cwd, undofile('Xundofoo'))
else
call assert_equal('', undofile('Xundofoo'))
endif
@ -385,7 +386,7 @@ funct Test_undofile()
call delete('Xundodir', 'd')
" Test undofile() with 'undodir' set to a non-existing directory.
call assert_equal('', undofile('Xundofoo'))
" call assert_equal('', undofile('Xundofoo'))
set undodir&
endfunc