Add a new test for TS motions

This commit is contained in:
Andy K. Massimino
2021-08-27 20:01:39 -04:00
parent 0a1655c669
commit c51d532577
6 changed files with 98 additions and 0 deletions

View File

@@ -6,9 +6,27 @@ let &rtp = &rtp . ',../../../after'
profile start /tmp/vim-profile.txt
profile! file */matchup/*.vim
if has('nvim-0.5.0')
let s:path = simplify(expand('<sfile>:h').'/../../..')
let &rtp = s:path.'/test/vader/plugged/nvim-treesitter,' . &rtp
let &rtp .= ','.s:path.'/test/vader/plugged/nvim-treesitter/after'
lua <<EOF
require'nvim-treesitter.configs'.setup {
matchup = {
enable = true
}
}
EOF
runtime! plugin/nvim-treesitter.vim
endif
filetype plugin indent on
syntax enable
set notimeout
let g:matchup_override_vimtex = 1
runtime! plugin/matchup.vim

View File

@@ -0,0 +1,9 @@
.PHONY: test
MYVIM ?= nvim --headless
INMAKE := 1
export INMAKE
test:
@$(MYVIM) -u test.vim

View File

@@ -0,0 +1,13 @@
def F(x, y):
if x == 1:
return 1
elif x == 2:
if y == 5:
pass
elif y == 7:
return 9
else:
return x
else:
return 3
return 2

View File

@@ -0,0 +1,5 @@
unless false
return
else
return
end

View File

@@ -0,0 +1,35 @@
set nocompatible
source ../common/bootstrap.vim
if !has('nvim')
finish
endif
function! s:assert_ts_active()
call assert_true(index(
\ b:matchup_active_engines.delim_all, 'tree_sitter') > -1)
endfunction
" python
silent edit example.py
call s:assert_ts_active()
0go
norm %
call assert_equal([3, 10], getcurpos()[1:2])
norm 2%
call assert_equal([10, 12], getcurpos()[1:2])
" ruby
silent edit example.rb
call s:assert_ts_active()
0go
norm %
call assert_equal([3, 4], getcurpos()[1:2])
norm 2%
call assert_equal([1, 1], getcurpos()[1:2])
call matchup#test#finished()