File: test-clear.vim

package info (click to toggle)
vim-vimtex 2.16-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 8,660 kB
  • sloc: makefile: 367; python: 103
file content (30 lines) | stat: -rw-r--r-- 862 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
set nocompatible
let &rtp = '../..,' . &rtp
filetype plugin on

nnoremap q :qall!<cr>

let g:vimtex_cache_root = '.'

" Clear global cache
let s:cache = vimtex#cache#open('test-clear')
call assert_equal('./test-clear.json', s:cache.path)
call s:cache.set('a', 1)
call assert_true(s:cache.has('a'))
call assert_true(filereadable(s:cache.path))
call s:cache.clear()
call assert_false(s:cache.has('a'))
call assert_false(filereadable(s:cache.path))

" Clear local cache
let b:vimtex = {'tex': '/foobar.tex'}
let s:cache = vimtex#cache#open('test-clear', {'local': 1})
call assert_equal('./test-clear%foobar.json', s:cache.path)
call s:cache.set('a', 1)
call assert_true(s:cache.has('a'))
call assert_true(filereadable(s:cache.path))
call s:cache.clear()
call assert_false(s:cache.has('a'))
call assert_false(filereadable(s:cache.path))

call vimtex#test#finished()