Mercurial > vim
comparison src/testdir/test_visual.vim @ 24756:ac7ad168caed v8.2.2916
patch 8.2.2916: operators are not fully tested
Commit: https://github.com/vim/vim/commit/2ac7184d34cd01e2b76bd1f704fd6a4b4af10239
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Mon May 31 19:23:01 2021 +0200
patch 8.2.2916: operators are not fully tested
Problem: Operators are not fully tested.
Solution: Add a few more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/8290)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 31 May 2021 19:30:04 +0200 |
parents | 1ce39e257f1b |
children | b032da736676 |
comparison
equal
deleted
inserted
replaced
24755:6173011dc313 | 24756:ac7ad168caed |
---|---|
816 %d _ | 816 %d _ |
817 call setline(1, ['123', '456', '789']) | 817 call setline(1, ['123', '456', '789']) |
818 exe "normal ld\<C-V>j" | 818 exe "normal ld\<C-V>j" |
819 call assert_equal(['13', '46', '789'], getline(1, '$')) | 819 call assert_equal(['13', '46', '789'], getline(1, '$')) |
820 | 820 |
821 bwipe! | 821 " Test from ':help v_b_I_example' |
822 %d _ | |
823 setlocal tabstop=8 shiftwidth=4 | |
824 let lines =<< trim END | |
825 abcdefghijklmnopqrstuvwxyz | |
826 abc defghijklmnopqrstuvwxyz | |
827 abcdef ghi jklmnopqrstuvwxyz | |
828 abcdefghijklmnopqrstuvwxyz | |
829 END | |
830 call setline(1, lines) | |
831 exe "normal ggfo\<C-V>3jISTRING" | |
832 let expected =<< trim END | |
833 abcdefghijklmnSTRINGopqrstuvwxyz | |
834 abc STRING defghijklmnopqrstuvwxyz | |
835 abcdef ghi STRING jklmnopqrstuvwxyz | |
836 abcdefghijklmnSTRINGopqrstuvwxyz | |
837 END | |
838 call assert_equal(expected, getline(1, '$')) | |
839 | |
840 " Test from ':help v_b_A_example' | |
841 %d _ | |
842 let lines =<< trim END | |
843 abcdefghijklmnopqrstuvwxyz | |
844 abc defghijklmnopqrstuvwxyz | |
845 abcdef ghi jklmnopqrstuvwxyz | |
846 abcdefghijklmnopqrstuvwxyz | |
847 END | |
848 call setline(1, lines) | |
849 exe "normal ggfo\<C-V>3j$ASTRING" | |
850 let expected =<< trim END | |
851 abcdefghijklmnopqrstuvwxyzSTRING | |
852 abc defghijklmnopqrstuvwxyzSTRING | |
853 abcdef ghi jklmnopqrstuvwxyzSTRING | |
854 abcdefghijklmnopqrstuvwxyzSTRING | |
855 END | |
856 call assert_equal(expected, getline(1, '$')) | |
857 | |
858 " Test from ':help v_b_<_example' | |
859 %d _ | |
860 let lines =<< trim END | |
861 abcdefghijklmnopqrstuvwxyz | |
862 abc defghijklmnopqrstuvwxyz | |
863 abcdef ghi jklmnopqrstuvwxyz | |
864 abcdefghijklmnopqrstuvwxyz | |
865 END | |
866 call setline(1, lines) | |
867 exe "normal ggfo\<C-V>3j3l<.." | |
868 let expected =<< trim END | |
869 abcdefghijklmnopqrstuvwxyz | |
870 abc defghijklmnopqrstuvwxyz | |
871 abcdef ghi jklmnopqrstuvwxyz | |
872 abcdefghijklmnopqrstuvwxyz | |
873 END | |
874 call assert_equal(expected, getline(1, '$')) | |
875 | |
876 " Test from ':help v_b_>_example' | |
877 %d _ | |
878 let lines =<< trim END | |
879 abcdefghijklmnopqrstuvwxyz | |
880 abc defghijklmnopqrstuvwxyz | |
881 abcdef ghi jklmnopqrstuvwxyz | |
882 abcdefghijklmnopqrstuvwxyz | |
883 END | |
884 call setline(1, lines) | |
885 exe "normal ggfo\<C-V>3j>.." | |
886 let expected =<< trim END | |
887 abcdefghijklmn opqrstuvwxyz | |
888 abc defghijklmnopqrstuvwxyz | |
889 abcdef ghi jklmnopqrstuvwxyz | |
890 abcdefghijklmn opqrstuvwxyz | |
891 END | |
892 call assert_equal(expected, getline(1, '$')) | |
893 | |
894 " Test from ':help v_b_r_example' | |
895 %d _ | |
896 let lines =<< trim END | |
897 abcdefghijklmnopqrstuvwxyz | |
898 abc defghijklmnopqrstuvwxyz | |
899 abcdef ghi jklmnopqrstuvwxyz | |
900 abcdefghijklmnopqrstuvwxyz | |
901 END | |
902 call setline(1, lines) | |
903 exe "normal ggfo\<C-V>5l3jrX" | |
904 let expected =<< trim END | |
905 abcdefghijklmnXXXXXXuvwxyz | |
906 abc XXXXXXhijklmnopqrstuvwxyz | |
907 abcdef ghi XXXXXX jklmnopqrstuvwxyz | |
908 abcdefghijklmnXXXXXXuvwxyz | |
909 END | |
910 call assert_equal(expected, getline(1, '$')) | |
911 | |
912 bwipe! | |
913 set tabstop& shiftwidth& | |
822 endfunc | 914 endfunc |
823 | 915 |
824 " Test block-insert using cursor keys for movement | 916 " Test block-insert using cursor keys for movement |
825 func Test_visual_block_insert_cursor_keys() | 917 func Test_visual_block_insert_cursor_keys() |
826 new | 918 new |