1
0
mirror of https://github.com/amix/vimrc synced 2025-07-10 11:44:59 +08:00

add Previm and window management

This commit is contained in:
Max Alcala
2016-02-23 14:35:43 -06:00
parent f3143286d3
commit 14bf4d01c6
45 changed files with 3967 additions and 77 deletions

View File

@ -0,0 +1,46 @@
let s:t = themis#suite('valid filetype for using :PrevimOpen')
let s:assert = themis#helper('assert')
function! s:t.before()
let self._ft = &filetype
endfunction
function! s:t.after()
let &filetype = self._ft
call s:_clean_command()
endfunction
function! s:_clean_command()
if exists(':PrevimOpen') == 2
delcommand PrevimOpen
endif
endfunction
" helper
function! s:_assert_filetype(ft, expected)
let &filetype = a:ft
let actual = exists(':PrevimOpen')
if actual !=# a:expected
call s:assert.fail(printf("'%s': expected %d but actual %d", a:ft, a:expected, actual))
endif
endfunction
"""
function! s:t.invalid_filetype()
let not_exist_command = 0
for type in ['', 'rb', 'php']
call s:_assert_filetype(type, not_exist_command)
endfor
endfunction
function! s:t.valid_filetype()
let exist_command = 2
for type in [
\ 'markdown', 'mkd', 'rst', 'textile',
\ 'aaa.markdown', 'mkd.foo', 'bb.rst.cc', 'a.b.c.textile',
\]
call s:_assert_filetype(type, exist_command)
call s:_clean_command()
endfor
endfunction