Skip to content

Commit 99531a7

Browse files
committed
patch 8.1.0817: ":=" command is not tested
Problem: ":=" command is not tested. Solution: Add a test. (Dominique Pelle, closes #3859)
1 parent 681b6bc commit 99531a7

4 files changed

Lines changed: 36 additions & 0 deletions

File tree

src/testdir/Make_all.mak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ NEW_TESTS = \
105105
test_erasebackword \
106106
test_escaped_glob \
107107
test_eval_stuff \
108+
test_ex_equal \
108109
test_ex_undo \
109110
test_ex_z \
110111
test_exit \

src/testdir/test_alot.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ source test_changedtick.vim
1010
source test_compiler.vim
1111
source test_cursor_func.vim
1212
source test_delete.vim
13+
source test_ex_equal.vim
1314
source test_ex_undo.vim
1415
source test_ex_z.vim
1516
source test_execute_func.vim

src/testdir/test_ex_equal.vim

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
" Test Ex := command.
2+
3+
func Test_ex_equal()
4+
new
5+
call setline(1, ["foo\tbar", "bar\tfoo"])
6+
7+
let a = execute('=')
8+
call assert_equal("\n2", a)
9+
10+
let a = execute('=#')
11+
call assert_equal("\n2\n 1 foo bar", a)
12+
13+
let a = execute('=l')
14+
call assert_equal("\n2\nfoo^Ibar$", a)
15+
16+
let a = execute('=p')
17+
call assert_equal("\n2\nfoo bar", a)
18+
19+
let a = execute('=l#')
20+
call assert_equal("\n2\n 1 foo^Ibar$", a)
21+
22+
let a = execute('=p#')
23+
call assert_equal("\n2\n 1 foo bar", a)
24+
25+
let a = execute('.=')
26+
call assert_equal("\n1", a)
27+
28+
call assert_fails('3=', 'E16:')
29+
call assert_fails('=x', 'E488:')
30+
31+
bwipe!
32+
endfunc

src/version.c

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

788788
static int included_patches[] =
789789
{ /* Add new patch number below this line */
790+
/**/
791+
817,
790792
/**/
791793
816,
792794
/**/

0 commit comments

Comments
 (0)