Skip to content

Commit

Permalink
test: fix bad test
Browse files Browse the repository at this point in the history
  • Loading branch information
lervag committed Aug 16, 2023
1 parent 85bf8a7 commit ae63bf6
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 49 deletions.
9 changes: 5 additions & 4 deletions test/test-textobj-targets/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ export INMAKE
.PHONY: test clean

test: test1.out
@diff test1.ok test1.out
@rm test1.out
@diff test.ok test1.out
@diff test.ok test2.out
@rm test1.out test2.out

test1.out: | targets.vim
@chronic $(MYVIM) -u test.vim
test%.out: | targets.vim
@$(MYVIM) -u test.vim

targets.vim:
@git clone https://github.com/wellle/targets.vim.git
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
cIlc a \cmd{ bbbbbbbb } \cmd{ _ } \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
cilc a \cmd{ bbbbbbbb } \cmd{_} \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
calc a \cmd{ bbbbbbbb } _ \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
cAlc a \cmd{ bbbbbbbb } _\cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
cIc a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ _ } \cmd{ eeeeeee } \cmd{ ffffffff }
cic a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{_} \cmd{ eeeeeee } \cmd{ ffffffff }
cac a \cmd{ bbbbbbbb } \cmd{ ccccccc } _ \cmd{ eeeeeee } \cmd{ ffffffff }
cAc a \cmd{ bbbbbbbb } \cmd{ ccccccc } _\cmd{ eeeeeee } \cmd{ ffffffff }
cInc a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ xxxxxx } \cmd{ _ } \cmd{ ffffffff }
cinc a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ xxxxxx } \cmd{_} \cmd{ ffffffff }
canc a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ xxxxxx } _ \cmd{ ffffffff }
cAnc a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ xxxxxx } _\cmd{ ffffffff }
c1Ilc a \cmd{ bbbbbbbb } \cmd{ _ } \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
c1ilc a \cmd{ bbbbbbbb } \cmd{_} \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
c1alc a \cmd{ bbbbbbbb } _ \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
c1Alc a \cmd{ bbbbbbbb } _\cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
c1Ic a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ _ } \cmd{ eeeeeee } \cmd{ ffffffff }
c1ic a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{_} \cmd{ eeeeeee } \cmd{ ffffffff }
c1ac a \cmd{ bbbbbbbb } \cmd{ ccccccc } _ \cmd{ eeeeeee } \cmd{ ffffffff }
c1Ac a \cmd{ bbbbbbbb } \cmd{ ccccccc } _\cmd{ eeeeeee } \cmd{ ffffffff }
c1Inc a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ xxxxxx } \cmd{ _ } \cmd{ ffffffff }
c1inc a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ xxxxxx } \cmd{_} \cmd{ ffffffff }
c1anc a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ xxxxxx } _ \cmd{ ffffffff }
c1Anc a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ xxxxxx } _\cmd{ ffffffff }
c2Ilc a \cmd{ _ } \cmd{ ccccccc } \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
c2ilc a \cmd{_} \cmd{ ccccccc } \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
c2alc a _ \cmd{ ccccccc } \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
c2Alc a _\cmd{ ccccccc } \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
c2Ic a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ _xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
c2ic a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ _xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
c2ac a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ _xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
c2Ac a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ _xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
c2Inc a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ _ }
c2inc a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{_}
c2anc a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ xxxxxx } \cmd{ eeeeeee } _
c2Anc a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ xxxxxx } \cmd{ eeeeeee }_
cIlc_ a \cmd{ bbbbbbbb } \cmd{ _ } \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
cilc_ a \cmd{ bbbbbbbb } \cmd{_} \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
calc_ a \cmd{ bbbbbbbb } _ \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
cAlc_ a \cmd{ bbbbbbbb } _\cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
cIc_ a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ _ } \cmd{ eeeeeee } \cmd{ ffffffff }
cic_ a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{_} \cmd{ eeeeeee } \cmd{ ffffffff }
cac_ a \cmd{ bbbbbbbb } \cmd{ ccccccc } _ \cmd{ eeeeeee } \cmd{ ffffffff }
cAc_ a \cmd{ bbbbbbbb } \cmd{ ccccccc } _\cmd{ eeeeeee } \cmd{ ffffffff }
cInc_ a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ xxxxxx } \cmd{ _ } \cmd{ ffffffff }
cinc_ a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ xxxxxx } \cmd{_} \cmd{ ffffffff }
canc_ a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ xxxxxx } _ \cmd{ ffffffff }
cAnc_ a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ xxxxxx } _\cmd{ ffffffff }
c1Ilc_ a \cmd{ bbbbbbbb } \cmd{ _ } \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
c1ilc_ a \cmd{ bbbbbbbb } \cmd{_} \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
c1alc_ a \cmd{ bbbbbbbb } _ \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
c1Alc_ a \cmd{ bbbbbbbb } _\cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
c1Ic_ a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ _ } \cmd{ eeeeeee } \cmd{ ffffffff }
c1ic_ a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{_} \cmd{ eeeeeee } \cmd{ ffffffff }
c1ac_ a \cmd{ bbbbbbbb } \cmd{ ccccccc } _ \cmd{ eeeeeee } \cmd{ ffffffff }
c1Ac_ a \cmd{ bbbbbbbb } \cmd{ ccccccc } _\cmd{ eeeeeee } \cmd{ ffffffff }
c1Inc_ a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ xxxxxx } \cmd{ _ } \cmd{ ffffffff }
c1inc_ a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ xxxxxx } \cmd{_} \cmd{ ffffffff }
c1anc_ a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ xxxxxx } _ \cmd{ ffffffff }
c1Anc_ a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ xxxxxx } _\cmd{ ffffffff }
c2Ilc_ a \cmd{ _ } \cmd{ ccccccc } \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
c2ilc_ a \cmd{_} \cmd{ ccccccc } \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
c2alc_ a _ \cmd{ ccccccc } \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
c2Alc_ a _\cmd{ ccccccc } \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
c2Ic_ a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
c2ic_ a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
c2ac_ a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
c2Ac_ a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
c2Inc_ a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ _ }
c2inc_ a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{_}
c2anc_ a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ xxxxxx } \cmd{ eeeeeee } _
c2Anc_ a \cmd{ bbbbbbbb } \cmd{ ccccccc } \cmd{ xxxxxx } \cmd{ eeeeeee }_
dIlc a \cmd{ bbbbbbbb } \cmd{ } \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
dilc a \cmd{ bbbbbbbb } \cmd{} \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
dalc a \cmd{ bbbbbbbb } \cmd{ xxxxxx } \cmd{ eeeeeee } \cmd{ ffffffff }
Expand Down
File renamed without changes.
17 changes: 8 additions & 9 deletions test/test-textobj-targets/test.vim
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ set noswapfile
set softtabstop=16
set expandtab

silent edit test1.tex
silent edit test.tex

if empty($INMAKE) | finish | endif

function! s:testVimtexCmdtargets()
function! s:testVimtexCmdtargets(name)
silent! edit!
call search('xxxxxx')
normal! "lyy

for operator in ['c', 'd', 'y', 'v']
Expand All @@ -34,12 +33,12 @@ function! s:testVimtexCmdtargets()
normal! "lp2f}l
call s:execute('v', 'ilc')

write! test1.out
execute 'silent write!' a:name
endfunction

function! s:execute(operation, motions)
execute 'normal' a:operation . a:motions
\ . (a:operation ==# 'c' ? '_' : '')
let l:cmd = a:operation . a:motions . (a:operation ==# 'c' ? '_' : '')
silent execute 'normal' l:cmd

if a:operation ==# 'v'
normal! r_
Expand All @@ -49,13 +48,13 @@ function! s:execute(operation, motions)
execute "normal! A\<tab>'\<c-r>\"'"
endif

execute 'normal! I' . a:operation . a:motions . "\<tab>"
execute 'normal! I' . l:cmd . "\<tab>"
endfunction

call s:testVimtexCmdtargets()
call s:testVimtexCmdtargets('test1.out')

" Tests should pass with this setting too
set selection=exclusive
call s:testVimtexCmdtargets()
call s:testVimtexCmdtargets('test2.out')

quit!

0 comments on commit ae63bf6

Please sign in to comment.