aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <janedmundlazo@hotmail.com>2018-08-09 19:30:48 -0400
committerJan Edmund Lazo <janedmundlazo@hotmail.com>2018-08-09 19:53:05 -0400
commit09c2184660e6b958025954218272ec304e8951ba (patch)
tree1d253b67324ab9fa8f22ce852bf1a716918e03c9
parent1c1722105c025869eab8dbd67fd289afdf0c6a4b (diff)
downloadrneovim-09c2184660e6b958025954218272ec304e8951ba.tar.gz
rneovim-09c2184660e6b958025954218272ec304e8951ba.tar.bz2
rneovim-09c2184660e6b958025954218272ec304e8951ba.zip
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.
-rw-r--r--src/nvim/testdir/setup.vim1
-rw-r--r--src/nvim/testdir/test_undo.vim7
2 files changed, 5 insertions, 3 deletions
diff --git a/src/nvim/testdir/setup.vim b/src/nvim/testdir/setup.vim
index 51bf8ce0fc..b38f50b501 100644
--- a/src/nvim/testdir/setup.vim
+++ b/src/nvim/testdir/setup.vim
@@ -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:$
diff --git a/src/nvim/testdir/test_undo.vim b/src/nvim/testdir/test_undo.vim
index 3dfb190a16..f31499607b 100644
--- a/src/nvim/testdir/test_undo.vim
+++ b/src/nvim/testdir/test_undo.vim
@@ -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