Skip to content

Commit e971df3

Browse files
committed
patch 8.0.0306: mode() not sufficiently tested
Problem: mode() not sufficiently tested. Solution: Add more tests. (Yegappan Lakshmanan)
1 parent aaaf57d commit e971df3

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

src/testdir/test_functions.vim

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,39 +320,73 @@ func! Test_mode()
320320
normal! 3G
321321
exe "normal i\<F2>\<Esc>"
322322
call assert_equal('i-i', g:current_modes)
323+
" i_CTRL-P: Multiple matches
323324
exe "normal i\<C-G>uBa\<C-P>\<F2>\<Esc>u"
324325
call assert_equal('i-ic', g:current_modes)
326+
" i_CTRL-P: Single match
325327
exe "normal iBro\<C-P>\<F2>\<Esc>u"
326328
call assert_equal('i-ic', g:current_modes)
329+
" i_CTRL-X
327330
exe "normal iBa\<C-X>\<F2>\<Esc>u"
328331
call assert_equal('i-ix', g:current_modes)
332+
" i_CTRL-X CTRL-P: Multiple matches
329333
exe "normal iBa\<C-X>\<C-P>\<F2>\<Esc>u"
330334
call assert_equal('i-ic', g:current_modes)
335+
" i_CTRL-X CTRL-P: Single match
331336
exe "normal iBro\<C-X>\<C-P>\<F2>\<Esc>u"
332337
call assert_equal('i-ic', g:current_modes)
338+
" i_CTRL-X CTRL-P + CTRL-P: Single match
333339
exe "normal iBro\<C-X>\<C-P>\<C-P>\<F2>\<Esc>u"
334340
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
335348
exe "normal iCom\<C-P>\<F2>\<Esc>u"
336349
call assert_equal('i-ic', g:current_modes)
350+
" i_CTRL-X CTRL-P: No match
337351
exe "normal iCom\<C-X>\<C-P>\<F2>\<Esc>u"
338352
call assert_equal('i-ic', g:current_modes)
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)
339356

357+
" R_CTRL-P: Multiple matches
340358
exe "normal RBa\<C-P>\<F2>\<Esc>u"
341359
call assert_equal('R-Rc', g:current_modes)
360+
" R_CTRL-P: Single match
342361
exe "normal RBro\<C-P>\<F2>\<Esc>u"
343362
call assert_equal('R-Rc', g:current_modes)
363+
" R_CTRL-X
344364
exe "normal RBa\<C-X>\<F2>\<Esc>u"
345365
call assert_equal('R-Rx', g:current_modes)
366+
" R_CTRL-X CTRL-P: Multiple matches
346367
exe "normal RBa\<C-X>\<C-P>\<F2>\<Esc>u"
347368
call assert_equal('R-Rc', g:current_modes)
369+
" R_CTRL-X CTRL-P: Single match
348370
exe "normal RBro\<C-X>\<C-P>\<F2>\<Esc>u"
349371
call assert_equal('R-Rc', g:current_modes)
372+
" R_CTRL-X CTRL-P + CTRL-P: Single match
350373
exe "normal RBro\<C-X>\<C-P>\<C-P>\<F2>\<Esc>u"
351374
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
352382
exe "normal RCom\<C-P>\<F2>\<Esc>u"
353383
call assert_equal('R-Rc', g:current_modes)
384+
" R_CTRL-X CTRL-P: No match
354385
exe "normal RCom\<C-X>\<C-P>\<F2>\<Esc>u"
355386
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"
389+
call assert_equal('R-Rc', g:current_modes)
356390

357391
call assert_equal('n', mode(0))
358392
call assert_equal('n', mode(1))

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
306,
767769
/**/
768770
305,
769771
/**/

0 commit comments

Comments
 (0)