Skip to content

Commit 00b24be

Browse files
committed
patch 7.4.2098
Problem: Text object tests are old style. Solution: Turn them into new style tests. (James McCoy, closes #941)
1 parent d4f31dc commit 00b24be

6 files changed

Lines changed: 50 additions & 58 deletions

File tree

src/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,9 @@ CClink = $(CC)
368368
# Carbon GUI for Mac OS X
369369
#CONF_OPT_GUI = --enable-gui=carbon
370370

371+
# Uncomment this line to run an indivisual test with gvim.
372+
#GUI_TESTARG = GUI_FLAG=-g
373+
371374
# DARWIN - detecting Mac OS X
372375
# Uncomment this line when you want to compile a Unix version of Vim on
373376
# Darwin. None of the Mac specific options or files will be used.
@@ -2031,7 +2034,6 @@ test1 \
20312034
test_search_mbyte \
20322035
test_signs \
20332036
test_tagcase \
2034-
test_textobjects \
20352037
test_utf8 \
20362038
test_wordcount \
20372039
test_writefile \
@@ -2112,6 +2114,7 @@ test_arglist \
21122114
test_syntax \
21132115
test_tabline \
21142116
test_tagjump \
2117+
test_textobjects \
21152118
test_timers \
21162119
test_true_false \
21172120
test_undolevels \

src/testdir/Make_all.mak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ SCRIPTS_ALL = \
108108
test_search_mbyte.out \
109109
test_signs.out \
110110
test_tagcase.out \
111-
test_textobjects.out \
112111
test_utf8.out \
113112
test_wordcount.out \
114113
test_writefile.out
@@ -187,6 +186,7 @@ NEW_TESTS = test_arglist.res \
187186
test_ruby.res \
188187
test_stat.res \
189188
test_syntax.res \
189+
test_textobjects.res \
190190
test_usercommands.res \
191191
test_viminfo.res \
192192
test_viml.res \

src/testdir/test_textobjects.in

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/testdir/test_textobjects.ok

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/testdir/test_textobjects.vim

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
" Test for textobjects
2+
3+
if !has('textobjects')
4+
finish
5+
endif
6+
7+
function! CpoM(line, useM, expected)
8+
new
9+
10+
if a:useM
11+
set cpoptions+=M
12+
else
13+
set cpoptions-=M
14+
endif
15+
16+
call setline(1, a:line)
17+
18+
call setreg('"', '')
19+
normal! ggfrmavi)y
20+
call assert_equal(getreg('"'), a:expected[0])
21+
22+
call setreg('"', '')
23+
normal! `afbmavi)y
24+
call assert_equal(getreg('"'), a:expected[1])
25+
26+
call setreg('"', '')
27+
normal! `afgmavi)y
28+
call assert_equal(getreg('"'), a:expected[2])
29+
30+
q!
31+
endfunction
32+
33+
function! Test_inner_block_without_cpo_M()
34+
call CpoM('(red \(blue) green)', 0, ['red \(blue', 'red \(blue', ''])
35+
endfunction
36+
37+
function! Test_inner_block_with_cpo_M_left_backslash()
38+
call CpoM('(red \(blue) green)', 1, ['red \(blue) green', 'blue', 'red \(blue) green'])
39+
endfunction
40+
41+
function! Test_inner_block_with_cpo_M_right_backslash()
42+
call CpoM('(red (blue\) green)', 1, ['red (blue\) green', 'blue\', 'red (blue\) green'])
43+
endfunction

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,8 @@ static char *(features[]) =
758758

759759
static int included_patches[] =
760760
{ /* Add new patch number below this line */
761+
/**/
762+
2098,
761763
/**/
762764
2097,
763765
/**/

0 commit comments

Comments
 (0)