diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-05-29 16:30:12 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-05-29 16:30:12 +0200 |
commit | 3e72dcad8b752a42b6eaf71213e3f5d534175256 (patch) | |
tree | 078ea4eea29f9d3bd3473ce7ccd978976826ddd7 /src/testdir/test_normal.vim | |
parent | 1174b018a6d705ddb8c04f3d21f78ae760aa0856 (diff) | |
download | vim-git-3e72dcad8b752a42b6eaf71213e3f5d534175256.tar.gz |
patch 8.2.2901: some operators not fully testedv8.2.2901
Problem: Some operators not fully tested.
Solution: Add a few test cases. (Yegappan Lakshmanan, closes #8282)
Diffstat (limited to 'src/testdir/test_normal.vim')
-rw-r--r-- | src/testdir/test_normal.vim | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim index 75b52bcb6..72a7253ff 100644 --- a/src/testdir/test_normal.vim +++ b/src/testdir/test_normal.vim @@ -1986,6 +1986,16 @@ func Test_normal30_changecase() call assert_equal(['aaaaaa', 'AAAAaa'], getline(1, 2)) set whichwrap& + " try changing the case with a double byte encoding (DBCS) + %bw! + let enc = &enc + set encoding=cp932 + call setline(1, "\u8470") + normal ~ + normal gU$gu$gUgUg~g~gugu + call assert_equal("\u8470", getline(1)) + let &encoding = enc + " clean up bw! endfunc @@ -3324,4 +3334,25 @@ func Test_normal_percent_jump() close! endfunc +" Test for << and >> commands to shift text by 'shiftwidth' +func Test_normal_shift_rightleft() + new + call setline(1, ['one', '', "\t", ' two', "\tthree", ' four']) + set shiftwidth=2 tabstop=8 + normal gg6>> + call assert_equal([' one', '', "\t ", ' two', "\t three", "\tfour"], + \ getline(1, '$')) + normal ggVG2>> + call assert_equal([' one', '', "\t ", "\ttwo", + \ "\t three", "\t four"], getline(1, '$')) + normal gg6<< + call assert_equal([' one', '', "\t ", ' two', "\t three", + \ "\t four"], getline(1, '$')) + normal ggVG2<< + call assert_equal(['one', '', "\t", ' two', "\tthree", ' four'], + \ getline(1, '$')) + set shiftwidth& tabstop& + bw! +endfunc + " vim: shiftwidth=2 sts=2 expandtab |