Skip to content

Commit cf34434

Browse files
zeertzjqbrammool
authored andcommitted
patch 9.0.0043: insufficient testing for bracket commands
Problem: Insufficient testing for bracket commands. Solution: Add a few more tests. (closes #10668)
1 parent 3244780 commit cf34434

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

src/testdir/test_normal.vim

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1994,9 +1994,16 @@ func Test_normal27_bracket()
19941994
call assert_equal(5, line('.'))
19951995
call assert_equal(3, col('.'))
19961996

1997-
" No mark after line 21, cursor moves to first non blank on current line
1997+
" No mark before line 1, cursor moves to first non-blank on current line
1998+
1
1999+
norm! 5|['
2000+
call assert_equal(' 1 b', getline('.'))
2001+
call assert_equal(1, line('.'))
2002+
call assert_equal(3, col('.'))
2003+
2004+
" No mark after line 21, cursor moves to first non-blank on current line
19982005
21
1999-
norm! $]'
2006+
norm! 5|]'
20002007
call assert_equal(' 21 b', getline('.'))
20012008
call assert_equal(21, line('.'))
20022009
call assert_equal(3, col('.'))
@@ -2013,6 +2020,34 @@ func Test_normal27_bracket()
20132020
call assert_equal(20, line('.'))
20142021
call assert_equal(8, col('.'))
20152022

2023+
" No mark before line 1, cursor does not move
2024+
1
2025+
norm! 5|[`
2026+
call assert_equal(' 1 b', getline('.'))
2027+
call assert_equal(1, line('.'))
2028+
call assert_equal(5, col('.'))
2029+
2030+
" No mark after line 21, cursor does not move
2031+
21
2032+
norm! 5|]`
2033+
call assert_equal(' 21 b', getline('.'))
2034+
call assert_equal(21, line('.'))
2035+
call assert_equal(5, col('.'))
2036+
2037+
" Count too large for [`
2038+
" cursor moves to first lowercase mark
2039+
norm! 99[`
2040+
call assert_equal(' 1 b', getline('.'))
2041+
call assert_equal(1, line('.'))
2042+
call assert_equal(7, col('.'))
2043+
2044+
" Count too large for ]`
2045+
" cursor moves to last lowercase mark
2046+
norm! 99]`
2047+
call assert_equal(' 20 b', getline('.'))
2048+
call assert_equal(20, line('.'))
2049+
call assert_equal(8, col('.'))
2050+
20162051
" clean up
20172052
bw!
20182053
endfunc

src/version.c

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

736736
static int included_patches[] =
737737
{ /* Add new patch number below this line */
738+
/**/
739+
43,
738740
/**/
739741
42,
740742
/**/

0 commit comments

Comments
 (0)