mirror of
https://github.com/vim/vim.git
synced 2025-10-05 05:34:07 -04:00
patch 8.0.1811: no test for winrestcmd()
Problem: No test for winrestcmd(). Solution: Add a test. (Dominique Pelle, closes #2894)
This commit is contained in:
@@ -17,7 +17,7 @@ func Test_window_cmd_ls0_with_split()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_window_cmd_cmdwin_with_vsp()
|
func Test_window_cmd_cmdwin_with_vsp()
|
||||||
let efmt='Expected 0 but got %d (in ls=%d, %s window)'
|
let efmt = 'Expected 0 but got %d (in ls=%d, %s window)'
|
||||||
for v in range(0, 2)
|
for v in range(0, 2)
|
||||||
exec "set ls=" . v
|
exec "set ls=" . v
|
||||||
vsplit
|
vsplit
|
||||||
@@ -444,21 +444,21 @@ func Test_window_contents()
|
|||||||
|
|
||||||
exe "norm! \<C-W>t\<C-W>=1Gzt\<C-W>w\<C-W>+"
|
exe "norm! \<C-W>t\<C-W>=1Gzt\<C-W>w\<C-W>+"
|
||||||
redraw
|
redraw
|
||||||
let s3=GetScreenStr(1)
|
let s3 = GetScreenStr(1)
|
||||||
wincmd p
|
wincmd p
|
||||||
call assert_equal(1, line("w0"))
|
call assert_equal(1, line("w0"))
|
||||||
call assert_equal('1 ', s3)
|
call assert_equal('1 ', s3)
|
||||||
|
|
||||||
exe "norm! \<C-W>t\<C-W>=50Gzt\<C-W>w\<C-W>+"
|
exe "norm! \<C-W>t\<C-W>=50Gzt\<C-W>w\<C-W>+"
|
||||||
redraw
|
redraw
|
||||||
let s3=GetScreenStr(1)
|
let s3 = GetScreenStr(1)
|
||||||
wincmd p
|
wincmd p
|
||||||
call assert_equal(50, line("w0"))
|
call assert_equal(50, line("w0"))
|
||||||
call assert_equal('50 ', s3)
|
call assert_equal('50 ', s3)
|
||||||
|
|
||||||
exe "norm! \<C-W>t\<C-W>=59Gzt\<C-W>w\<C-W>+"
|
exe "norm! \<C-W>t\<C-W>=59Gzt\<C-W>w\<C-W>+"
|
||||||
redraw
|
redraw
|
||||||
let s3=GetScreenStr(1)
|
let s3 = GetScreenStr(1)
|
||||||
wincmd p
|
wincmd p
|
||||||
call assert_equal(59, line("w0"))
|
call assert_equal(59, line("w0"))
|
||||||
call assert_equal('59 ', s3)
|
call assert_equal('59 ', s3)
|
||||||
@@ -507,4 +507,19 @@ func Test_visual_cleared_after_window_split()
|
|||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_winrestcmd()
|
||||||
|
2split
|
||||||
|
3vsplit
|
||||||
|
let a = winrestcmd()
|
||||||
|
call assert_equal(2, winheight(0))
|
||||||
|
call assert_equal(3, winwidth(0))
|
||||||
|
wincmd =
|
||||||
|
call assert_notequal(2, winheight(0))
|
||||||
|
call assert_notequal(3, winwidth(0))
|
||||||
|
exe a
|
||||||
|
call assert_equal(2, winheight(0))
|
||||||
|
call assert_equal(3, winwidth(0))
|
||||||
|
only
|
||||||
|
endfunc
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
@@ -761,6 +761,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1811,
|
||||||
/**/
|
/**/
|
||||||
1810,
|
1810,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user