mirror of
https://github.com/chenasraf/vim-matchup.git
synced 2026-05-17 17:38:01 +00:00
tests: remove references to nvim-treesitter
This commit is contained in:
@@ -3,23 +3,6 @@ set packpath-=~/.config/nvim packpath-=~/.config/nvim/after
|
||||
let &rtp = '../../..,' . &rtp
|
||||
let &rtp = &rtp . ',../../../after'
|
||||
|
||||
if $TESTS_ENABLE_TREESITTER
|
||||
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'
|
||||
|
||||
runtime! plugin/nvim-treesitter.vim
|
||||
runtime! plugin/nvim-treesitter.lua
|
||||
|
||||
lua <<EOF
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
matchup = {
|
||||
enable = true
|
||||
}
|
||||
}
|
||||
EOF
|
||||
endif
|
||||
|
||||
filetype plugin indent on
|
||||
syntax enable
|
||||
|
||||
|
||||
@@ -5,33 +5,16 @@ if !$TESTS_ENABLE_TREESITTER && $MODE > 0
|
||||
call matchup#test#finished()
|
||||
endif
|
||||
|
||||
let s:expect_ts_engine = +$TESTS_ENABLE_TREESITTER
|
||||
let g:matchup_treesitter_enabled = v:false
|
||||
let s:expect_ts_engine = $MODE == 0 ? 0 : +$TESTS_ENABLE_TREESITTER
|
||||
|
||||
if $MODE == 1
|
||||
lua <<EOF
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
highlight = { enable = true },
|
||||
matchup = { enable = true }
|
||||
}
|
||||
EOF
|
||||
let g:matchup_treesitter_enabled = v:true
|
||||
autocmd FileType *.rb lua vim.treesitter.start()
|
||||
elseif $MODE == 2
|
||||
lua <<EOF
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
highlight = { enable = true },
|
||||
matchup = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = true
|
||||
}
|
||||
}
|
||||
EOF
|
||||
let g:matchup_treesitter_enabled = v:true
|
||||
elseif $MODE == 3
|
||||
lua <<EOF
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
highlight = { enable = true },
|
||||
matchup = { enable = false }
|
||||
}
|
||||
EOF
|
||||
|
||||
let g:matchup_treesitter_enabled = v:false
|
||||
let s:expect_ts_engine = 0
|
||||
endif
|
||||
|
||||
|
||||
@@ -12,22 +12,6 @@ let &rtp = s:path.'/test/rtp,' . &rtp
|
||||
" load other plugins, if necessary
|
||||
" let &rtp = '~/path/to/other/plugin,' . &rtp
|
||||
|
||||
if $TESTS_ENABLE_TREESITTER
|
||||
let &rtp = s:path.'/test/vader/plugged/nvim-treesitter,' . &rtp
|
||||
let &rtp .= ','.s:path.'/test/vader/plugged/nvim-treesitter/after'
|
||||
|
||||
runtime! plugin/nvim-treesitter.vim
|
||||
runtime! plugin/nvim-treesitter.lua
|
||||
|
||||
lua <<EOF
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
matchup = {
|
||||
enable = true
|
||||
}
|
||||
}
|
||||
EOF
|
||||
endif
|
||||
|
||||
if empty(globpath(&rtp, 'plugin/vader.vim'))
|
||||
echoerr 'vader not found'
|
||||
exit!
|
||||
|
||||
@@ -1,14 +1,3 @@
|
||||
Execute (Helper):
|
||||
function! TSActive()
|
||||
return exists(':TSInstall')
|
||||
endfunction
|
||||
|
||||
if TSActive()
|
||||
Log 'nvim-treesitter active'
|
||||
else
|
||||
Log 'nvim-treesitter not active'
|
||||
endif
|
||||
|
||||
Given python (A python script):
|
||||
def F(x, y):
|
||||
if x == 1:
|
||||
@@ -35,22 +24,22 @@ Before (Cursor):
|
||||
Do (Move %):
|
||||
%
|
||||
Then (Verify line):
|
||||
AssertEqual (TSActive() ? 4 : 2), line('.')
|
||||
AssertEqual (len(b:matchup_active_engines.delim_all) == 2 ? 4 : 2), line('.')
|
||||
|
||||
Do (Move % twice):
|
||||
%%
|
||||
Then (Verify line):
|
||||
AssertEqual (TSActive() ? 11 : 2), line('.')
|
||||
AssertEqual (len(b:matchup_active_engines.delim_all) == 2 ? 11 : 2), line('.')
|
||||
|
||||
Do (Move % 3 times):
|
||||
%%%
|
||||
Then (Verify line):
|
||||
AssertEqual (TSActive() ? 2 : 2), line('.')
|
||||
AssertEqual (len(b:matchup_active_engines.delim_all) == 2 ? 2 : 2), line('.')
|
||||
|
||||
Do (Move % 4 times):
|
||||
%%%%
|
||||
Then (Verify line):
|
||||
AssertEqual (TSActive() ? 4 : 2), line('.')
|
||||
AssertEqual (len(b:matchup_active_engines.delim_all) == 2 ? 4 : 2), line('.')
|
||||
|
||||
# ----- inner if/elif/else -----
|
||||
|
||||
@@ -60,19 +49,19 @@ Before (Cursor):
|
||||
Do (Inner: Move %):
|
||||
%
|
||||
Then (Verify line):
|
||||
AssertEqual (TSActive() ? 7 : 5), line('.')
|
||||
AssertEqual (len(b:matchup_active_engines.delim_all) == 2 ? 7 : 5), line('.')
|
||||
|
||||
Do (Inner: % 2 times):
|
||||
%%
|
||||
Then (Verify line):
|
||||
AssertEqual (TSActive() ? 9 : 5), line('.')
|
||||
AssertEqual (len(b:matchup_active_engines.delim_all) == 2 ? 9 : 5), line('.')
|
||||
|
||||
Do (Inner: % 3 times):
|
||||
%%%
|
||||
Then (Verify line):
|
||||
AssertEqual (TSActive() ? 5 : 5), line('.')
|
||||
AssertEqual (len(b:matchup_active_engines.delim_all) == 2 ? 5 : 5), line('.')
|
||||
|
||||
Do (Inner: % 4 times):
|
||||
%%%%
|
||||
Then (Verify line):
|
||||
AssertEqual (TSActive() ? 7 : 5), line('.')
|
||||
AssertEqual (len(b:matchup_active_engines.delim_all) == 2 ? 7 : 5), line('.')
|
||||
|
||||
Reference in New Issue
Block a user