|
1 | 1 | " Tests for tabpage |
2 | 2 |
|
| 3 | + |
3 | 4 | function Test_tabpage() |
4 | 5 | bw! |
5 | 6 | " Simple test for opening and closing a tab page |
@@ -317,6 +318,34 @@ function s:reconstruct_tabpage_for_test(nr) |
317 | 318 | endfor |
318 | 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 | 349 | " Test for [count] of tabclose |
321 | 350 | function Test_tabpage_with_tabclose() |
322 | 351 |
|
@@ -491,4 +520,18 @@ func Test_close_on_quitpre() |
491 | 520 | buf Xtest |
492 | 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 | 537 | " vim: shiftwidth=2 sts=2 expandtab |
0 commit comments