Skip to content

Commit 72cf47a

Browse files
committed
patch 8.0.1811: no test for winrestcmd()
Problem: No test for winrestcmd(). Solution: Add a test. (Dominique Pelle, closes #2894)
1 parent 56bc8e2 commit 72cf47a

2 files changed

Lines changed: 21 additions & 4 deletions

File tree

src/testdir/test_window_cmd.vim

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func Test_window_cmd_ls0_with_split()
1717
endfunc
1818

1919
func Test_window_cmd_cmdwin_with_vsp()
20-
let efmt='Expected 0 but got %d (in ls=%d, %s window)'
20+
let efmt = 'Expected 0 but got %d (in ls=%d, %s window)'
2121
for v in range(0, 2)
2222
exec "set ls=" . v
2323
vsplit
@@ -444,21 +444,21 @@ func Test_window_contents()
444444

445445
exe "norm! \<C-W>t\<C-W>=1Gzt\<C-W>w\<C-W>+"
446446
redraw
447-
let s3=GetScreenStr(1)
447+
let s3 = GetScreenStr(1)
448448
wincmd p
449449
call assert_equal(1, line("w0"))
450450
call assert_equal('1 ', s3)
451451

452452
exe "norm! \<C-W>t\<C-W>=50Gzt\<C-W>w\<C-W>+"
453453
redraw
454-
let s3=GetScreenStr(1)
454+
let s3 = GetScreenStr(1)
455455
wincmd p
456456
call assert_equal(50, line("w0"))
457457
call assert_equal('50 ', s3)
458458

459459
exe "norm! \<C-W>t\<C-W>=59Gzt\<C-W>w\<C-W>+"
460460
redraw
461-
let s3=GetScreenStr(1)
461+
let s3 = GetScreenStr(1)
462462
wincmd p
463463
call assert_equal(59, line("w0"))
464464
call assert_equal('59 ', s3)
@@ -507,4 +507,19 @@ func Test_visual_cleared_after_window_split()
507507
bwipe!
508508
endfunc
509509

510+
func Test_winrestcmd()
511+
2split
512+
3vsplit
513+
let a = winrestcmd()
514+
call assert_equal(2, winheight(0))
515+
call assert_equal(3, winwidth(0))
516+
wincmd =
517+
call assert_notequal(2, winheight(0))
518+
call assert_notequal(3, winwidth(0))
519+
exe a
520+
call assert_equal(2, winheight(0))
521+
call assert_equal(3, winwidth(0))
522+
only
523+
endfunc
524+
510525
" 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+
1811,
764766
/**/
765767
1810,
766768
/**/

0 commit comments

Comments
 (0)