Skip to content

Commit

Permalink
fix: different behaviour vim vs neovim
Browse files Browse the repository at this point in the history
  • Loading branch information
lervag committed Jan 29, 2024
1 parent 1907ec9 commit 32d8541
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions test/test-cache/test-write-error.vim
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,23 @@ let g:vimtex_cache_root = '.'

call vimtex#log#set_silent()

let s:cache_name = 'test-write-error'
let s:cache_file = s:cache_name . '.json'
let s:cache = vimtex#cache#open(s:cache_name)
call s:cache.set('bad', "Usuário")
call s:cache.write()
if has('nvim')
let s:cache_name = 'test-write-error'
let s:cache_file = s:cache_name . '.json'
let s:cache = vimtex#cache#open(s:cache_name)
call s:cache.set('bad', "Usuário")
call s:cache.write()

let s:log = vimtex#log#get()
call assert_equal(1, len(s:log))
call assert_equal(
\ printf('Could not encode cache "%s"', s:cache_name),
\ s:log[0].msg[0]
\)
let s:log = vimtex#log#get()
call assert_equal(1, len(s:log))
if len(s:log) > 0
call assert_equal(
\ printf('Could not encode cache "%s"', s:cache_name),
\ s:log[0].msg[0]
\)
endif

if filereadable(s:cache_file) | call delete(s:cache_file) | endif
if filereadable(s:cache_file) | call delete(s:cache_file) | endif
endif

call vimtex#test#finished()

0 comments on commit 32d8541

Please sign in to comment.