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 31 32 33 34 35 36 37 38 39
|
Describe TeX pairs should work
" Note: the tests in this file (as well as any others requiring
" specific filetypes) need to have unique filenames. Otherwise,
" settings are preserved and tests fail
Before each
call autopairs#Variables#InitVariables()
End
It should work with pairs starting with a backslash
new TexBackslashBase.tex | only!
call Expect(&ft).to_equal('tex')
call Expect('[').ToMatch('[]')
call Expect('\[').ToMatch('\[\]')
call Expect('\\[').ToMatch('\\[')
call Expect('\\\[').ToMatch('\\\[\]')
call Expect('\(').ToMatch('\(\)')
End
It should handle BS appropriately
let g:AutoPairsMapBS = 1
new TexBSBase.tex | only!
call Expect(&ft).to_equal('tex')
call Expect(b:AutoPairsMapBS).to_equal(1)
call Expect("\\(\<BS>").ToMatch('')
call Expect("\\[\<BS>").ToMatch('')
End
It should handle CR appropriately
new TexCRBase.tex | only!
call Expect(&ft).to_equal('tex')
call Expect("\\(\<CR>").ToMatch('\(\n\n\)')
call Expect("\\[\<CR>").ToMatch('\[\n\n\]')
End
It should handle jumps
new TexJumpBase.tex | only!
call Expect('\(\').ToMatch('\(\\)')
call Expect('\[\').ToMatch('\[\\]')
End
End
|