Skip to content

Commit dbe8869

Browse files
committed
patch 8.1.0009: tabpages insufficiently tested
Problem: Tabpages insufficiently tested. Solution: Add more test coverage. (Dominique Pelle, closes #2934)
1 parent 42ab17b commit dbe8869

2 files changed

Lines changed: 45 additions & 0 deletions

File tree

src/testdir/test_tabpage.vim

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
" Tests for tabpage
22

3+
34
function Test_tabpage()
45
bw!
56
" Simple test for opening and closing a tab page
@@ -317,6 +318,34 @@ function s:reconstruct_tabpage_for_test(nr)
317318
endfor
318319
endfunc
319320

321+
func Test_tabpage_ctrl_pgup_pgdown()
322+
enew!
323+
tabnew tab1
324+
tabnew tab2
325+
326+
call assert_equal(3, tabpagenr())
327+
exe "norm! \<C-PageUp>"
328+
call assert_equal(2, tabpagenr())
329+
exe "norm! \<C-PageDown>"
330+
call assert_equal(3, tabpagenr())
331+
332+
" Check wrapping at last or first page.
333+
exe "norm! \<C-PageDown>"
334+
call assert_equal(1, tabpagenr())
335+
exe "norm! \<C-PageUp>"
336+
call assert_equal(3, tabpagenr())
337+
338+
" With a count, <C-PageUp> and <C-PageDown> are not symmetrical somehow:
339+
" - {count}<C-PageUp> goes {count} pages downward (relative count)
340+
" - {count}<C-PageDown> goes to page number {count} (absolute count)
341+
exe "norm! 2\<C-PageUp>"
342+
call assert_equal(1, tabpagenr())
343+
exe "norm! 2\<C-PageDown>"
344+
call assert_equal(2, tabpagenr())
345+
346+
1tabonly!
347+
endfunc
348+
320349
" Test for [count] of tabclose
321350
function Test_tabpage_with_tabclose()
322351

@@ -491,4 +520,18 @@ func Test_close_on_quitpre()
491520
buf Xtest
492521
endfunc
493522

523+
func Test_tabs()
524+
enew!
525+
tabnew tab1
526+
norm ixxx
527+
let a=split(execute(':tabs'), "\n")
528+
call assert_equal(['Tab page 1',
529+
\ ' [No Name]',
530+
\ 'Tab page 2',
531+
\ '> + tab1'], a)
532+
533+
1tabonly!
534+
bw!
535+
endfunc
536+
494537
" vim: shiftwidth=2 sts=2 expandtab

src/version.c

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

762762
static int included_patches[] =
763763
{ /* Add new patch number below this line */
764+
/**/
765+
9,
764766
/**/
765767
8,
766768
/**/

0 commit comments

Comments
 (0)