Mercurial > vim
comparison src/testdir/test_window_cmd.vim @ 18031:8a2fb21c23c0 v8.1.2011
patch 8.1.2011: more functions can be used as methods
Commit: https://github.com/vim/vim/commit/ce90e36f5969e733a0a919f1736453332c33aad6
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Sep 8 18:58:44 2019 +0200
patch 8.1.2011: more functions can be used as methods
Problem: More functions can be used as methods.
Solution: Make various functions usable as a method. Make the window
command test faster.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 08 Sep 2019 19:00:04 +0200 |
parents | a4e488a6655c |
children | 11dca9732a48 |
comparison
equal
deleted
inserted
replaced
18030:e7a81e948c12 | 18031:8a2fb21c23c0 |
---|---|
483 split Xc | 483 split Xc |
484 | 484 |
485 wincmd T | 485 wincmd T |
486 call assert_equal(2, tabpagenr('$')) | 486 call assert_equal(2, tabpagenr('$')) |
487 call assert_equal(['Xb', 'Xa'], map(tabpagebuflist(1), 'bufname(v:val)')) | 487 call assert_equal(['Xb', 'Xa'], map(tabpagebuflist(1), 'bufname(v:val)')) |
488 call assert_equal(['Xc' ], map(tabpagebuflist(2), 'bufname(v:val)')) | 488 call assert_equal(['Xc' ], map(2->tabpagebuflist(), 'bufname(v:val)')) |
489 | 489 |
490 %bw! | 490 %bw! |
491 endfunc | 491 endfunc |
492 | 492 |
493 func Test_next_split_all() | 493 func Test_next_split_all() |
596 only | 596 only |
597 endfunc | 597 endfunc |
598 | 598 |
599 func Fun_RenewFile() | 599 func Fun_RenewFile() |
600 " Need to wait a bit for the timestamp to be older. | 600 " Need to wait a bit for the timestamp to be older. |
601 sleep 2 | 601 let old_ftime = getftime("tmp.txt") |
602 silent execute '!echo "1" > tmp.txt' | 602 while getftime("tmp.txt") == old_ftime |
603 sleep 100m | |
604 silent execute '!echo "1" > tmp.txt' | |
605 endwhile | |
603 sp | 606 sp |
604 wincmd p | 607 wincmd p |
605 edit! tmp.txt | 608 edit! tmp.txt |
606 endfunc | 609 endfunc |
607 | 610 |
833 call assert_fails("echo winnr('5')", 'E15:') | 836 call assert_fails("echo winnr('5')", 'E15:') |
834 call assert_equal(4, winnr('0h')) | 837 call assert_equal(4, winnr('0h')) |
835 | 838 |
836 tabnew | 839 tabnew |
837 call assert_equal(8, tabpagewinnr(1, 'j')) | 840 call assert_equal(8, tabpagewinnr(1, 'j')) |
838 call assert_equal(2, tabpagewinnr(1, 'k')) | 841 call assert_equal(2, 1->tabpagewinnr('k')) |
839 call assert_equal(4, tabpagewinnr(1, 'h')) | 842 call assert_equal(4, tabpagewinnr(1, 'h')) |
840 call assert_equal(6, tabpagewinnr(1, 'l')) | 843 call assert_equal(6, tabpagewinnr(1, 'l')) |
841 | 844 |
842 only | tabonly | 845 only | tabonly |
843 endfunc | 846 endfunc |