Mercurial > vim
comparison src/testdir/test_edit.vim @ 21765:08940efa6b4e v8.2.1432
patch 8.2.1432: various inconsistencies in test files
Commit: https://github.com/vim/vim/commit/6d91bcb4d23b5c6a0be72c384beaf385e2d9d606
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Aug 12 18:50:36 2020 +0200
patch 8.2.1432: various inconsistencies in test files
Problem: Various inconsistencies in test files.
Solution: Add modelines where they were missing. Use Check commands instead
of silently skipping over tests. Adjust indents and comments.
(Ken Takata, closes #6695)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 12 Aug 2020 19:00:08 +0200 |
parents | 93dae47699fb |
children | 23a5977d7211 |
comparison
equal
deleted
inserted
replaced
21764:476b6faad407 | 21765:08940efa6b4e |
---|---|
154 bw! | 154 bw! |
155 endfunc | 155 endfunc |
156 | 156 |
157 func Test_edit_06() | 157 func Test_edit_06() |
158 " Test in diff mode | 158 " Test in diff mode |
159 if !has("diff") || !executable("diff") | 159 CheckFeature diff |
160 return | 160 CheckExecutable diff |
161 endif | |
162 new | 161 new |
163 call setline(1, ['abc', 'xxx', 'yyy']) | 162 call setline(1, ['abc', 'xxx', 'yyy']) |
164 vnew | 163 vnew |
165 call setline(1, ['abc', 'zzz', 'xxx', 'yyy']) | 164 call setline(1, ['abc', 'zzz', 'xxx', 'yyy']) |
166 wincmd p | 165 wincmd p |
414 | 413 |
415 func Test_edit_CR() | 414 func Test_edit_CR() |
416 " Test for <CR> in insert mode | 415 " Test for <CR> in insert mode |
417 " basically only in quickfix mode ist tested, the rest | 416 " basically only in quickfix mode ist tested, the rest |
418 " has been taken care of by other tests | 417 " has been taken care of by other tests |
419 if !has("quickfix") | 418 CheckFeature quickfix |
420 return | |
421 endif | |
422 botright new | 419 botright new |
423 call writefile(range(1, 10), 'Xqflist.txt') | 420 call writefile(range(1, 10), 'Xqflist.txt') |
424 call setqflist([{'filename': 'Xqflist.txt', 'lnum': 2}]) | 421 call setqflist([{'filename': 'Xqflist.txt', 'lnum': 2}]) |
425 copen | 422 copen |
426 set modifiable | 423 set modifiable |
444 lclose | 441 lclose |
445 call delete('Xqflist.txt') | 442 call delete('Xqflist.txt') |
446 endfunc | 443 endfunc |
447 | 444 |
448 func Test_edit_CTRL_() | 445 func Test_edit_CTRL_() |
446 CheckFeature rightleft | |
449 " disabled for Windows builds, why? | 447 " disabled for Windows builds, why? |
450 if !has("rightleft") || has("win32") | 448 CheckNotMSWindows |
451 return | |
452 endif | |
453 let _encoding=&encoding | 449 let _encoding=&encoding |
454 set encoding=utf-8 | 450 set encoding=utf-8 |
455 " Test for CTRL-_ | 451 " Test for CTRL-_ |
456 new | 452 new |
457 call setline(1, ['abc']) | 453 call setline(1, ['abc']) |
949 bw! | 945 bw! |
950 " TODO: How to Test Ctrl-Z in insert mode, e.g. suspend? | 946 " TODO: How to Test Ctrl-Z in insert mode, e.g. suspend? |
951 endfunc | 947 endfunc |
952 | 948 |
953 func Test_edit_DROP() | 949 func Test_edit_DROP() |
954 if !has("dnd") | 950 CheckFeature dnd |
955 return | |
956 endif | |
957 new | 951 new |
958 call setline(1, ['abc def ghi']) | 952 call setline(1, ['abc def ghi']) |
959 call cursor(1, 1) | 953 call cursor(1, 1) |
960 try | 954 try |
961 call feedkeys("i\<Drop>\<Esc>", 'tnix') | 955 call feedkeys("i\<Drop>\<Esc>", 'tnix') |
965 endtry | 959 endtry |
966 bw! | 960 bw! |
967 endfunc | 961 endfunc |
968 | 962 |
969 func Test_edit_CTRL_V() | 963 func Test_edit_CTRL_V() |
970 if has("ebcdic") | 964 CheckFeature ebcdic |
971 return | |
972 endif | |
973 new | 965 new |
974 call setline(1, ['abc']) | 966 call setline(1, ['abc']) |
975 call cursor(2, 1) | 967 call cursor(2, 1) |
976 " force some redraws | 968 " force some redraws |
977 set showmode showcmd | 969 set showmode showcmd |
1007 endfunc | 999 endfunc |
1008 | 1000 |
1009 func Test_edit_F21() | 1001 func Test_edit_F21() |
1010 " Pressing <f21> | 1002 " Pressing <f21> |
1011 " sends a netbeans command | 1003 " sends a netbeans command |
1012 if has("netbeans_intg") | 1004 CheckFeature netbeans_intg |
1013 new | 1005 new |
1014 " I have no idea what this is supposed to do :) | 1006 " I have no idea what this is supposed to do :) |
1015 call feedkeys("A\<F21>\<F1>\<esc>", 'tnix') | 1007 call feedkeys("A\<F21>\<F1>\<esc>", 'tnix') |
1016 bw | 1008 bw |
1017 endif | |
1018 endfunc | 1009 endfunc |
1019 | 1010 |
1020 func Test_edit_HOME_END() | 1011 func Test_edit_HOME_END() |
1021 " Test Home/End Keys | 1012 " Test Home/End Keys |
1022 new | 1013 new |
1093 bw! | 1084 bw! |
1094 endfunc | 1085 endfunc |
1095 | 1086 |
1096 func Test_edit_MOUSE() | 1087 func Test_edit_MOUSE() |
1097 " This is a simple test, since we not really using the mouse here | 1088 " This is a simple test, since we not really using the mouse here |
1098 if !has("mouse") | 1089 CheckFeature mouse |
1099 return | |
1100 endif | |
1101 10new | 1090 10new |
1102 call setline(1, range(1, 100)) | 1091 call setline(1, range(1, 100)) |
1103 call cursor(1, 1) | 1092 call cursor(1, 1) |
1104 set mouse=a | 1093 set mouse=a |
1105 call feedkeys("A\<ScrollWheelDown>\<esc>", 'tnix') | 1094 call feedkeys("A\<ScrollWheelDown>\<esc>", 'tnix') |
1364 set norightleft | 1353 set norightleft |
1365 bw! | 1354 bw! |
1366 endfunc | 1355 endfunc |
1367 | 1356 |
1368 func Test_edit_complete_very_long_name() | 1357 func Test_edit_complete_very_long_name() |
1369 if !has('unix') | 1358 " Long directory names only work on Unix. |
1370 " Long directory names only work on Unix. | 1359 CheckUnix |
1371 return | |
1372 endif | |
1373 | 1360 |
1374 let dirname = getcwd() . "/Xdir" | 1361 let dirname = getcwd() . "/Xdir" |
1375 let longdirname = dirname . repeat('/' . repeat('d', 255), 4) | 1362 let longdirname = dirname . repeat('/' . repeat('d', 255), 4) |
1376 try | 1363 try |
1377 call mkdir(longdirname, 'p') | 1364 call mkdir(longdirname, 'p') |
1708 | 1695 |
1709 " Test for 'hkmap' and 'hkmapp' | 1696 " Test for 'hkmap' and 'hkmapp' |
1710 func Test_edit_hkmap() | 1697 func Test_edit_hkmap() |
1711 CheckFeature rightleft | 1698 CheckFeature rightleft |
1712 if has('win32') && !has('gui') | 1699 if has('win32') && !has('gui') |
1713 " Test fails on the MS-Windows terminal version | 1700 throw 'Skipped: fails on the MS-Windows terminal version' |
1714 return | |
1715 endif | 1701 endif |
1716 new | 1702 new |
1717 | 1703 |
1718 set revins hkmap | 1704 set revins hkmap |
1719 let str = 'abcdefghijklmnopqrstuvwxyz' | 1705 let str = 'abcdefghijklmnopqrstuvwxyz' |