mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.0.0558: :ownsyntax is not tested
Problem: The :ownsyntax command is not tested.
Solution: Add a test. (Dominique Pelle, closes vim/vim#1622)
f8ec998613
This commit is contained in:
parent
39a03c0fe7
commit
245b1ad7fa
@ -382,3 +382,32 @@ func Test_conceal()
|
||||
set conceallevel&
|
||||
bw!
|
||||
endfunc
|
||||
|
||||
func Test_ownsyntax()
|
||||
new Xfoo
|
||||
call setline(1, '#define FOO')
|
||||
syntax on
|
||||
set filetype=c
|
||||
ownsyntax perl
|
||||
call assert_equal('perlComment', synIDattr(synID(line('.'), col('.'), 1), 'name'))
|
||||
call assert_equal('c', b:current_syntax)
|
||||
call assert_equal('perl', w:current_syntax)
|
||||
|
||||
" A new split window should have the original syntax.
|
||||
split
|
||||
call assert_equal('cDefine', synIDattr(synID(line('.'), col('.'), 1), 'name'))
|
||||
call assert_equal('c', b:current_syntax)
|
||||
call assert_equal(0, exists('w:current_syntax'))
|
||||
|
||||
wincmd x
|
||||
call assert_equal('perlComment', synIDattr(synID(line("."), col("."), 1), "name"))
|
||||
|
||||
syntax off
|
||||
set filetype&
|
||||
%bw!
|
||||
endfunc
|
||||
|
||||
func Test_ownsyntax_completion()
|
||||
call feedkeys(":ownsyntax java\<C-A>\<C-B>\"\<CR>", 'tx')
|
||||
call assert_equal('"ownsyntax java javacc javascript', @:)
|
||||
endfunc
|
||||
|
Loading…
Reference in New Issue
Block a user