Mercurial > vim
comparison src/testdir/test_normal.vim @ 10092:d7846e9fbf65 v7.4.2317
commit https://github.com/vim/vim/commit/0913a1089a07ac7b17abc3a1343dfa7cd25613f4
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Sep 3 19:11:59 2016 +0200
patch 7.4.2317
Problem: Normal mode tests fail on MS-Windows.
Solution: Do some tests only on Unix. Set 'fileformat' to "unix".
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 03 Sep 2016 19:15:06 +0200 |
parents | 5337340beea0 |
children | b80ad55d62d8 |
comparison
equal
deleted
inserted
replaced
10091:9e5e3392f9b6 | 10092:d7846e9fbf65 |
---|---|
1135 set spellfile= | 1135 set spellfile= |
1136 bw! | 1136 bw! |
1137 endfu | 1137 endfu |
1138 | 1138 |
1139 func! Test_normal20_exmode() | 1139 func! Test_normal20_exmode() |
1140 if !(has("win32") || has("win64")) | 1140 if !has("unix") |
1141 " Reading from redirected file doesn't work on MS-Windows | |
1141 return | 1142 return |
1142 endif | 1143 endif |
1143 call writefile(['1a', 'foo', 'bar', '.', 'w! Xfile2', 'q!'], 'Xscript') | 1144 call writefile(['1a', 'foo', 'bar', '.', 'w! Xfile2', 'q!'], 'Xscript') |
1144 call writefile(['1', '2'], 'Xfile') | 1145 call writefile(['1', '2'], 'Xfile') |
1145 call system(v:progpath .' -e -s < Xscript Xfile') | 1146 call system(v:progpath .' -e -s < Xscript Xfile') |
1166 bw! | 1167 bw! |
1167 endfu | 1168 endfu |
1168 | 1169 |
1169 func! Test_normal22_zet() | 1170 func! Test_normal22_zet() |
1170 " Test for ZZ | 1171 " Test for ZZ |
1171 let shell = &shell | 1172 " let shell = &shell |
1172 let &shell = 'sh' | 1173 " let &shell = 'sh' |
1173 call writefile(['1', '2'], 'Xfile') | 1174 call writefile(['1', '2'], 'Xfile') |
1174 let args = ' -u NONE -N -U NONE -i NONE --noplugins -X --not-a-term' | 1175 let args = ' -u NONE -N -U NONE -i NONE --noplugins -X --not-a-term' |
1175 call system(v:progpath . args . ' -c "%d" -c ":norm! ZZ" Xfile') | 1176 call system(v:progpath . args . ' -c "%d" -c ":norm! ZZ" Xfile') |
1176 let a = readfile('Xfile') | 1177 let a = readfile('Xfile') |
1177 call assert_equal([], a) | 1178 call assert_equal([], a) |
1183 | 1184 |
1184 " clean up | 1185 " clean up |
1185 for file in ['Xfile'] | 1186 for file in ['Xfile'] |
1186 call delete(file) | 1187 call delete(file) |
1187 endfor | 1188 endfor |
1188 let &shell = shell | 1189 " let &shell = shell |
1189 endfu | 1190 endfu |
1190 | 1191 |
1191 func! Test_normal23_K() | 1192 func! Test_normal23_K() |
1192 " Test for K command | 1193 " Test for K command |
1193 new | 1194 new |
1204 call assert_equal('version8.txt', fnamemodify(bufname('%'), ':t')) | 1205 call assert_equal('version8.txt', fnamemodify(bufname('%'), ':t')) |
1205 call assert_equal('help', &ft) | 1206 call assert_equal('help', &ft) |
1206 call assert_match('\*version8\.0\*', getline('.')) | 1207 call assert_match('\*version8\.0\*', getline('.')) |
1207 helpclose | 1208 helpclose |
1208 | 1209 |
1209 if !(has("win32") || has("win64")) | 1210 " Only expect "man" to work on Unix |
1211 if !has("unix") | |
1210 let &keywordprg = k | 1212 let &keywordprg = k |
1211 bw! | 1213 bw! |
1212 return | 1214 return |
1213 endif | 1215 endif |
1214 set keywordprg=man\ --pager=cat | 1216 set keywordprg=man\ --pager=cat |
1640 norm! g^yl | 1642 norm! g^yl |
1641 call assert_equal(15, col('.')) | 1643 call assert_equal(15, col('.')) |
1642 call assert_equal('l', getreg(0)) | 1644 call assert_equal('l', getreg(0)) |
1643 | 1645 |
1644 " Test for g Ctrl-G | 1646 " Test for g Ctrl-G |
1647 set ff=unix | |
1645 let a=execute(":norm! g\<c-g>") | 1648 let a=execute(":norm! g\<c-g>") |
1646 call assert_match('Col 15 of 43; Line 2 of 2; Word 2 of 2; Byte 16 of 45', a) | 1649 call assert_match('Col 15 of 43; Line 2 of 2; Word 2 of 2; Byte 16 of 45', a) |
1647 | 1650 |
1648 " Test for gI | 1651 " Test for gI |
1649 norm! gIfoo | 1652 norm! gIfoo |
1690 endfu | 1693 endfu |
1691 | 1694 |
1692 fun! Test_normal36_g_cmd5() | 1695 fun! Test_normal36_g_cmd5() |
1693 new | 1696 new |
1694 call append(0, 'abcdefghijklmnopqrstuvwxyz') | 1697 call append(0, 'abcdefghijklmnopqrstuvwxyz') |
1698 set ff=unix | |
1695 " Test for gp gP | 1699 " Test for gp gP |
1696 call append(1, range(1,10)) | 1700 call append(1, range(1,10)) |
1697 1 | 1701 1 |
1698 norm! 1yy | 1702 norm! 1yy |
1699 3 | 1703 3 |