Mercurial > vim
comparison src/testdir/test_tabpage.vim @ 13982:29bad8212db3 v8.1.0009
patch 8.1.0009: tabpages insufficiently tested
commit https://github.com/vim/vim/commit/dbe8869c41a3b3309207a434c17db295d358e873
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun May 20 14:57:22 2018 +0200
patch 8.1.0009: tabpages insufficiently tested
Problem: Tabpages insufficiently tested.
Solution: Add more test coverage. (Dominique Pelle, closes https://github.com/vim/vim/issues/2934)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 20 May 2018 15:00:06 +0200 |
parents | 50e1077e0c3d |
children | f713e016097d |
comparison
equal
deleted
inserted
replaced
13981:5511d996e15a | 13982:29bad8212db3 |
---|---|
1 " Tests for tabpage | 1 " Tests for tabpage |
2 | |
2 | 3 |
3 function Test_tabpage() | 4 function Test_tabpage() |
4 bw! | 5 bw! |
5 " Simple test for opening and closing a tab page | 6 " Simple test for opening and closing a tab page |
6 tabnew | 7 tabnew |
315 call setline(1, ['', '', '3']) | 316 call setline(1, ['', '', '3']) |
316 endif | 317 endif |
317 endfor | 318 endfor |
318 endfunc | 319 endfunc |
319 | 320 |
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 | |
320 " Test for [count] of tabclose | 349 " Test for [count] of tabclose |
321 function Test_tabpage_with_tabclose() | 350 function Test_tabpage_with_tabclose() |
322 | 351 |
323 " pre count | 352 " pre count |
324 call s:reconstruct_tabpage_for_test(6) | 353 call s:reconstruct_tabpage_for_test(6) |
489 bwipe! | 518 bwipe! |
490 endwhile | 519 endwhile |
491 buf Xtest | 520 buf Xtest |
492 endfunc | 521 endfunc |
493 | 522 |
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 | |
494 " vim: shiftwidth=2 sts=2 expandtab | 537 " vim: shiftwidth=2 sts=2 expandtab |