From 004a6781b3cf15ca5dd632c38cc09bb3b253d1f8 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 11 Apr 2020 17:09:31 +0200 Subject: patch 8.2.0540: regexp and other code not tested Problem: Regexp and other code not tested. Solution: Add more tests. (Yegappan Lakshmanan, closes #5904) --- src/testdir/test_increment.vim | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/testdir/test_increment.vim') diff --git a/src/testdir/test_increment.vim b/src/testdir/test_increment.vim index 4aa7adf200..31d3ef9a70 100644 --- a/src/testdir/test_increment.vim +++ b/src/testdir/test_increment.vim @@ -475,6 +475,10 @@ func Test_visual_increment_20() exec "norm! \" call assert_equal(["b"], getline(1, '$')) call assert_equal([0, 1, 1, 0], getpos('.')) + " decrement a and A and increment z and Z + call setline(1, ['a', 'A', 'z', 'Z']) + exe "normal 1G\2G\3G\4G\" + call assert_equal(['a', 'A', 'z', 'Z'], getline(1, '$')) endfunc " 21) block-wise increment on part of hexadecimal @@ -565,12 +569,14 @@ endfunc " 1) " 0b11111111111111111111111111111111 func Test_visual_increment_26() - set nrformats+=alpha + set nrformats+=bin call setline(1, ["0b11111111111111111111111111111110"]) exec "norm! \$\" call assert_equal(["0b11111111111111111111111111111111"], getline(1, '$')) call assert_equal([0, 1, 1, 0], getpos('.')) - set nrformats-=alpha + exec "norm! \$\" + call assert_equal(["0b11111111111111111111111111111110"], getline(1, '$')) + set nrformats-=bin endfunc " 27) increment with 'rightreft', if supported @@ -771,7 +777,6 @@ func Test_normal_increment_03() endfunc func Test_increment_empty_line() - new call setline(1, ['0', '0', '0', '0', '0', '0', '']) exe "normal Gvgg\" call assert_equal(['1', '1', '1', '1', '1', '1', ''], getline(1, 7)) @@ -782,8 +787,13 @@ func Test_increment_empty_line() exe "normal! c\l" exe "normal! c\l" call assert_equal('one two', getline(1)) +endfunc - bwipe! +" Try incrementing/decrementing a non-digit/alpha character +func Test_increment_special_char() + call setline(1, '!') + call assert_beeps("normal \") + call assert_beeps("normal \") endfunc " vim: shiftwidth=2 sts=2 expandtab -- cgit v1.2.3