summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-09-04 14:41:21 +0200
committerBram Moolenaar <Bram@vim.org>2020-09-04 14:41:21 +0200
commitfe6dce873954a216eedb686bd5006710ffff4b89 (patch)
tree90a6e90aabf33844e920ee914fa9b894d27bd378
parentfa57335e532e505ce9229ddb2354a593fb057561 (diff)
patch 8.2.1586: :resize command not fully testedv8.2.1586
Problem: :resize command not fully tested. Solution: Add a couple of tests. (Dominique Pellé, closes #6857)
-rw-r--r--src/testdir/test_window_cmd.vim42
-rw-r--r--src/version.c2
2 files changed, 44 insertions, 0 deletions
diff --git a/src/testdir/test_window_cmd.vim b/src/testdir/test_window_cmd.vim
index a352ae1a5f..88141a94fe 100644
--- a/src/testdir/test_window_cmd.vim
+++ b/src/testdir/test_window_cmd.vim
@@ -1106,6 +1106,48 @@ func Test_wincmd_fails()
call assert_beeps("normal \<C-W>2gt")
endfunc
+func Test_window_resize()
+ " Vertical :resize (absolute, relative, min and max size).
+ vsplit
+ vert resize 8
+ call assert_equal(8, winwidth(0))
+ vert resize +2
+ call assert_equal(10, winwidth(0))
+ vert resize -2
+ call assert_equal(8, winwidth(0))
+ vert resize
+ call assert_equal(&columns - 2, winwidth(0))
+ vert resize 0
+ call assert_equal(1, winwidth(0))
+ vert resize 99999
+ call assert_equal(&columns - 2, winwidth(0))
+
+ %bwipe!
+
+ " Horizontal :resize (with absolute, relative size, min and max size).
+ split
+ resize 8
+ call assert_equal(8, winheight(0))
+ resize +2
+ call assert_equal(10, winheight(0))
+ resize -2
+ call assert_equal(8, winheight(0))
+ resize
+ call assert_equal(&lines - 4, winheight(0))
+ resize 0
+ call assert_equal(1, winheight(0))
+ resize 99999
+ call assert_equal(&lines - 4, winheight(0))
+
+ " :resize with explicit window number.
+ let other_winnr = winnr('j')
+ exe other_winnr .. 'resize 10'
+ call assert_equal(10, winheight(other_winnr))
+ call assert_equal(&lines - 10 - 3, winheight(0))
+
+ %bwipe!
+endfunc
+
" Test for adjusting the window width when a window is closed with some
" windows using 'winfixwidth'
func Test_window_width_adjust()
diff --git a/src/version.c b/src/version.c
index 338bb55704..86c2cfe50f 100644
--- a/src/version.c
+++ b/src/version.c
@@ -755,6 +755,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1586,
+/**/
1585,
/**/
1584,