mirror of
https://github.com/chenasraf/vim-matchup.git
synced 2026-05-18 01:38:57 +00:00
Add test for ts syn skip cases
This commit is contained in:
11
test/new/test-syn/Makefile
Normal file
11
test/new/test-syn/Makefile
Normal file
@@ -0,0 +1,11 @@
|
||||
.PHONY: test
|
||||
|
||||
MYVIM ?= nvim --headless
|
||||
|
||||
INMAKE := 1
|
||||
export INMAKE
|
||||
|
||||
test:
|
||||
@MODE=0 $(MYVIM) -u test.vim
|
||||
@MODE=1 $(MYVIM) -u test.vim
|
||||
@MODE=2 $(MYVIM) -u test.vim
|
||||
7
test/new/test-syn/example.rb
Normal file
7
test/new/test-syn/example.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
describe '#foo' do
|
||||
context 'when foo' do
|
||||
it 'bars' do
|
||||
expect(1).to eq(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
40
test/new/test-syn/test.vim
Normal file
40
test/new/test-syn/test.vim
Normal file
@@ -0,0 +1,40 @@
|
||||
set nocompatible
|
||||
source ../common/bootstrap.vim
|
||||
|
||||
if !$TESTS_ENABLE_TREESITTER && $MODE > 0
|
||||
call matchup#test#finished()
|
||||
endif
|
||||
|
||||
if $MODE == 1
|
||||
lua <<EOF
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
highlight = { enable = true },
|
||||
matchup = { enable = true }
|
||||
}
|
||||
EOF
|
||||
elseif $MODE == 2
|
||||
lua <<EOF
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
highlight = { enable = true },
|
||||
matchup = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = true
|
||||
}
|
||||
}
|
||||
EOF
|
||||
endif
|
||||
|
||||
silent edit example.rb
|
||||
|
||||
function! s:match_test(pos, check) abort
|
||||
call matchup#pos#set_cursor(a:pos)
|
||||
normal %
|
||||
let l:curpos = matchup#pos#get_cursor()[1:2]
|
||||
call matchup#test#assert_equal(a:check, l:curpos)
|
||||
endfunction
|
||||
|
||||
call s:match_test([7, 1], [1, 17])
|
||||
call s:match_test([6, 3], [2, 22])
|
||||
call s:match_test([5, 5], [3, 15])
|
||||
|
||||
call matchup#test#finished()
|
||||
Reference in New Issue
Block a user