mirror of
https://github.com/chenasraf/vim-matchup.git
synced 2026-05-17 17:38:01 +00:00
Add new testing
This commit is contained in:
31
test/new/Makefile
Normal file
31
test/new/Makefile
Normal file
@@ -0,0 +1,31 @@
|
||||
MYVIM ?= nvim --headless
|
||||
MAKEFLAGS+=--no-print-directory
|
||||
|
||||
TESTS := $(wildcard test-*)
|
||||
|
||||
.PHONY: test $(TESTS)
|
||||
|
||||
test: $(TESTS)
|
||||
|
||||
sysinfo:
|
||||
@echo "**** SYSTEM INFORMATION ****"
|
||||
@-git log -1
|
||||
@-$(MYVIM) --version
|
||||
@echo "**** SYSTEM INFORMATION ****"
|
||||
|
||||
$(TESTS):
|
||||
$(MAKE) -C $@
|
||||
|
||||
coverage: htmlcov/index.html
|
||||
|
||||
htmlcov/index.html: env /tmp/vim-profile.txt
|
||||
. env/bin/activate
|
||||
covimerage write_coverage /tmp/vim-profile.txt --source ../../autoload --source ../../plugin
|
||||
coverage report -m
|
||||
coverage html
|
||||
|
||||
env: env/pyvenv.cfg
|
||||
|
||||
env/pyvenv.cfg:
|
||||
python3 -m venv env
|
||||
bash -c 'source env/bin/activate; pip install "click<8.0.0" covimerage'
|
||||
16
test/new/common/bootstrap.vim
Normal file
16
test/new/common/bootstrap.vim
Normal file
@@ -0,0 +1,16 @@
|
||||
set packpath-=~/.vim packpath-=~/.vim/after
|
||||
set packpath-=~/.config/nvim packpath-=~/.config/nvim/after
|
||||
let &rtp = '../../..,' . &rtp
|
||||
let &rtp = &rtp . ',../../../after'
|
||||
|
||||
profile start /tmp/vim-profile.txt
|
||||
profile! file */matchup/*.vim
|
||||
|
||||
filetype plugin indent on
|
||||
syntax enable
|
||||
|
||||
let g:matchup_override_vimtex = 1
|
||||
|
||||
runtime! plugin/matchup.vim
|
||||
|
||||
nnoremap q :qall!<cr>
|
||||
9
test/new/test-delim/Makefile
Normal file
9
test/new/test-delim/Makefile
Normal file
@@ -0,0 +1,9 @@
|
||||
.PHONY: test
|
||||
|
||||
MYVIM ?= nvim --headless
|
||||
|
||||
INMAKE := 1
|
||||
export INMAKE
|
||||
|
||||
test:
|
||||
@$(MYVIM) -u test.vim
|
||||
12
test/new/test-delim/test.tex
Normal file
12
test/new/test-delim/test.tex
Normal file
@@ -0,0 +1,12 @@
|
||||
\[
|
||||
\begin{gathered}
|
||||
First equation \\
|
||||
Second equation \\[1ex]
|
||||
Third and last equation
|
||||
\end{gathered}
|
||||
\]
|
||||
|
||||
\begin{a}
|
||||
\begin{b}
|
||||
\end{c}
|
||||
\end{d}
|
||||
21
test/new/test-delim/test.vim
Normal file
21
test/new/test-delim/test.vim
Normal file
@@ -0,0 +1,21 @@
|
||||
set nocompatible
|
||||
source ../common/bootstrap.vim
|
||||
|
||||
let g:tex_flavor = "latex"
|
||||
|
||||
silent edit test.tex
|
||||
|
||||
call matchup#perf#timeout_start(0)
|
||||
|
||||
normal! 7G
|
||||
let s:current = matchup#delim#get_current('all', 'both')
|
||||
let s:corresponding = matchup#delim#get_matching(s:current)
|
||||
call matchup#test#assert_equal(1, s:corresponding[0].lnum)
|
||||
|
||||
normal! 9G
|
||||
let s:current = matchup#delim#get_current('all', 'both')
|
||||
let s:corresponding = matchup#delim#get_matching(s:current)
|
||||
call matchup#test#assert_equal(9, s:current.lnum)
|
||||
call matchup#test#assert_equal(1, len(s:corresponding))
|
||||
|
||||
quit!
|
||||
Reference in New Issue
Block a user