Mercurial > vim
comparison src/testdir/test_functions.vim @ 10833:d66e5446cc48 v8.0.0306
patch 8.0.0306: mode() not sufficiently tested
commit https://github.com/vim/vim/commit/e971df39a5aac5d9b7e8033247dc18b12daa0eb8
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Feb 5 14:15:29 2017 +0100
patch 8.0.0306: mode() not sufficiently tested
Problem: mode() not sufficiently tested.
Solution: Add more tests. (Yegappan Lakshmanan)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 05 Feb 2017 14:30:04 +0100 |
parents | 09926123316b |
children | 5780bd3a5a7e |
comparison
equal
deleted
inserted
replaced
10832:2ba168ecddac | 10833:d66e5446cc48 |
---|---|
318 inoremap <F2> <C-R>=Save_mode()<CR> | 318 inoremap <F2> <C-R>=Save_mode()<CR> |
319 | 319 |
320 normal! 3G | 320 normal! 3G |
321 exe "normal i\<F2>\<Esc>" | 321 exe "normal i\<F2>\<Esc>" |
322 call assert_equal('i-i', g:current_modes) | 322 call assert_equal('i-i', g:current_modes) |
323 " i_CTRL-P: Multiple matches | |
323 exe "normal i\<C-G>uBa\<C-P>\<F2>\<Esc>u" | 324 exe "normal i\<C-G>uBa\<C-P>\<F2>\<Esc>u" |
324 call assert_equal('i-ic', g:current_modes) | 325 call assert_equal('i-ic', g:current_modes) |
326 " i_CTRL-P: Single match | |
325 exe "normal iBro\<C-P>\<F2>\<Esc>u" | 327 exe "normal iBro\<C-P>\<F2>\<Esc>u" |
326 call assert_equal('i-ic', g:current_modes) | 328 call assert_equal('i-ic', g:current_modes) |
329 " i_CTRL-X | |
327 exe "normal iBa\<C-X>\<F2>\<Esc>u" | 330 exe "normal iBa\<C-X>\<F2>\<Esc>u" |
328 call assert_equal('i-ix', g:current_modes) | 331 call assert_equal('i-ix', g:current_modes) |
332 " i_CTRL-X CTRL-P: Multiple matches | |
329 exe "normal iBa\<C-X>\<C-P>\<F2>\<Esc>u" | 333 exe "normal iBa\<C-X>\<C-P>\<F2>\<Esc>u" |
330 call assert_equal('i-ic', g:current_modes) | 334 call assert_equal('i-ic', g:current_modes) |
335 " i_CTRL-X CTRL-P: Single match | |
331 exe "normal iBro\<C-X>\<C-P>\<F2>\<Esc>u" | 336 exe "normal iBro\<C-X>\<C-P>\<F2>\<Esc>u" |
332 call assert_equal('i-ic', g:current_modes) | 337 call assert_equal('i-ic', g:current_modes) |
338 " i_CTRL-X CTRL-P + CTRL-P: Single match | |
333 exe "normal iBro\<C-X>\<C-P>\<C-P>\<F2>\<Esc>u" | 339 exe "normal iBro\<C-X>\<C-P>\<C-P>\<F2>\<Esc>u" |
334 call assert_equal('i-ic', g:current_modes) | 340 call assert_equal('i-ic', g:current_modes) |
341 " i_CTRL-X CTRL-L: Multiple matches | |
342 exe "normal i\<C-X>\<C-L>\<F2>\<Esc>u" | |
343 call assert_equal('i-ic', g:current_modes) | |
344 " i_CTRL-X CTRL-L: Single match | |
345 exe "normal iBlu\<C-X>\<C-L>\<F2>\<Esc>u" | |
346 call assert_equal('i-ic', g:current_modes) | |
347 " i_CTRL-P: No match | |
335 exe "normal iCom\<C-P>\<F2>\<Esc>u" | 348 exe "normal iCom\<C-P>\<F2>\<Esc>u" |
336 call assert_equal('i-ic', g:current_modes) | 349 call assert_equal('i-ic', g:current_modes) |
350 " i_CTRL-X CTRL-P: No match | |
337 exe "normal iCom\<C-X>\<C-P>\<F2>\<Esc>u" | 351 exe "normal iCom\<C-X>\<C-P>\<F2>\<Esc>u" |
338 call assert_equal('i-ic', g:current_modes) | 352 call assert_equal('i-ic', g:current_modes) |
339 | 353 " i_CTRL-X CTRL-L: No match |
354 exe "normal iabc\<C-X>\<C-L>\<F2>\<Esc>u" | |
355 call assert_equal('i-ic', g:current_modes) | |
356 | |
357 " R_CTRL-P: Multiple matches | |
340 exe "normal RBa\<C-P>\<F2>\<Esc>u" | 358 exe "normal RBa\<C-P>\<F2>\<Esc>u" |
341 call assert_equal('R-Rc', g:current_modes) | 359 call assert_equal('R-Rc', g:current_modes) |
360 " R_CTRL-P: Single match | |
342 exe "normal RBro\<C-P>\<F2>\<Esc>u" | 361 exe "normal RBro\<C-P>\<F2>\<Esc>u" |
343 call assert_equal('R-Rc', g:current_modes) | 362 call assert_equal('R-Rc', g:current_modes) |
363 " R_CTRL-X | |
344 exe "normal RBa\<C-X>\<F2>\<Esc>u" | 364 exe "normal RBa\<C-X>\<F2>\<Esc>u" |
345 call assert_equal('R-Rx', g:current_modes) | 365 call assert_equal('R-Rx', g:current_modes) |
366 " R_CTRL-X CTRL-P: Multiple matches | |
346 exe "normal RBa\<C-X>\<C-P>\<F2>\<Esc>u" | 367 exe "normal RBa\<C-X>\<C-P>\<F2>\<Esc>u" |
347 call assert_equal('R-Rc', g:current_modes) | 368 call assert_equal('R-Rc', g:current_modes) |
369 " R_CTRL-X CTRL-P: Single match | |
348 exe "normal RBro\<C-X>\<C-P>\<F2>\<Esc>u" | 370 exe "normal RBro\<C-X>\<C-P>\<F2>\<Esc>u" |
349 call assert_equal('R-Rc', g:current_modes) | 371 call assert_equal('R-Rc', g:current_modes) |
372 " R_CTRL-X CTRL-P + CTRL-P: Single match | |
350 exe "normal RBro\<C-X>\<C-P>\<C-P>\<F2>\<Esc>u" | 373 exe "normal RBro\<C-X>\<C-P>\<C-P>\<F2>\<Esc>u" |
351 call assert_equal('R-Rc', g:current_modes) | 374 call assert_equal('R-Rc', g:current_modes) |
375 " R_CTRL-X CTRL-L: Multiple matches | |
376 exe "normal R\<C-X>\<C-L>\<F2>\<Esc>u" | |
377 call assert_equal('R-Rc', g:current_modes) | |
378 " R_CTRL-X CTRL-L: Single match | |
379 exe "normal RBlu\<C-X>\<C-L>\<F2>\<Esc>u" | |
380 call assert_equal('R-Rc', g:current_modes) | |
381 " R_CTRL-P: No match | |
352 exe "normal RCom\<C-P>\<F2>\<Esc>u" | 382 exe "normal RCom\<C-P>\<F2>\<Esc>u" |
353 call assert_equal('R-Rc', g:current_modes) | 383 call assert_equal('R-Rc', g:current_modes) |
384 " R_CTRL-X CTRL-P: No match | |
354 exe "normal RCom\<C-X>\<C-P>\<F2>\<Esc>u" | 385 exe "normal RCom\<C-X>\<C-P>\<F2>\<Esc>u" |
386 call assert_equal('R-Rc', g:current_modes) | |
387 " R_CTRL-X CTRL-L: No match | |
388 exe "normal Rabc\<C-X>\<C-L>\<F2>\<Esc>u" | |
355 call assert_equal('R-Rc', g:current_modes) | 389 call assert_equal('R-Rc', g:current_modes) |
356 | 390 |
357 call assert_equal('n', mode(0)) | 391 call assert_equal('n', mode(0)) |
358 call assert_equal('n', mode(1)) | 392 call assert_equal('n', mode(1)) |
359 | 393 |