diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-07-06 12:57:31 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-07-06 12:57:31 +0100 |
commit | cf34434b5e840dda4a21cd9c0bee24e3e43a674d (patch) | |
tree | 6c68a3e9ebcac7dd15c82dfdd33a399a8a2de9b5 /src/testdir | |
parent | 324478037923feef1eb8a771648e38ade9e5e05a (diff) |
patch 9.0.0043: insufficient testing for bracket commandsv9.0.0043
Problem: Insufficient testing for bracket commands.
Solution: Add a few more tests. (closes #10668)
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_normal.vim | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim index f00dcd0460..86f0ef656b 100644 --- a/src/testdir/test_normal.vim +++ b/src/testdir/test_normal.vim @@ -1994,9 +1994,16 @@ func Test_normal27_bracket() call assert_equal(5, line('.')) call assert_equal(3, col('.')) - " No mark after line 21, cursor moves to first non blank on current line + " No mark before line 1, cursor moves to first non-blank on current line + 1 + norm! 5|[' + call assert_equal(' 1 b', getline('.')) + call assert_equal(1, line('.')) + call assert_equal(3, col('.')) + + " No mark after line 21, cursor moves to first non-blank on current line 21 - norm! $]' + norm! 5|]' call assert_equal(' 21 b', getline('.')) call assert_equal(21, line('.')) call assert_equal(3, col('.')) @@ -2013,6 +2020,34 @@ func Test_normal27_bracket() call assert_equal(20, line('.')) call assert_equal(8, col('.')) + " No mark before line 1, cursor does not move + 1 + norm! 5|[` + call assert_equal(' 1 b', getline('.')) + call assert_equal(1, line('.')) + call assert_equal(5, col('.')) + + " No mark after line 21, cursor does not move + 21 + norm! 5|]` + call assert_equal(' 21 b', getline('.')) + call assert_equal(21, line('.')) + call assert_equal(5, col('.')) + + " Count too large for [` + " cursor moves to first lowercase mark + norm! 99[` + call assert_equal(' 1 b', getline('.')) + call assert_equal(1, line('.')) + call assert_equal(7, col('.')) + + " Count too large for ]` + " cursor moves to last lowercase mark + norm! 99]` + call assert_equal(' 20 b', getline('.')) + call assert_equal(20, line('.')) + call assert_equal(8, col('.')) + " clean up bw! endfunc |