summaryrefslogtreecommitdiff
path: root/src/testdir/test_window_cmd.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-01-29 10:59:53 +0000
committerBram Moolenaar <Bram@vim.org>2022-01-29 10:59:53 +0000
commita0c4e2f2d7aa164d9d7692702c752ea063bd3a8c (patch)
tree3537a2b9dd2fe0308c33c23ecfc1fbb3111afc26 /src/testdir/test_window_cmd.vim
parent06f15416bb8d5636200a10776f1752c4d6e49f31 (diff)
downloadvim-git-a0c4e2f2d7aa164d9d7692702c752ea063bd3a8c.tar.gz
patch 8.2.4248: no proper test for moving the window separatorv8.2.4248
Problem: No proper test for moving the window separator. Solution: Add a test. Add comment in code. (closes #9656)
Diffstat (limited to 'src/testdir/test_window_cmd.vim')
-rw-r--r--src/testdir/test_window_cmd.vim19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/testdir/test_window_cmd.vim b/src/testdir/test_window_cmd.vim
index e04216025..19b4466b9 100644
--- a/src/testdir/test_window_cmd.vim
+++ b/src/testdir/test_window_cmd.vim
@@ -1424,6 +1424,12 @@ func Test_win_move_separator()
call assert_true(id->win_move_separator(-offset))
call assert_equal(w, winwidth(id))
endfor
+ " check win_move_separator from right window on right window is no-op
+ let w0 = winwidth(0)
+ call assert_true(win_move_separator(0, 1))
+ call assert_equal(w0, winwidth(0))
+ call assert_true(win_move_separator(0, -1))
+ call assert_equal(w0, winwidth(0))
" check that win_move_separator doesn't error with offsets beyond moving
" possibility
call assert_true(win_move_separator(id, 5000))
@@ -1465,6 +1471,19 @@ func Test_win_move_statusline()
call assert_true(win_move_statusline(1, -offset))
call assert_equal(h, winheight(1))
endfor
+ " check win_move_statusline from bottom window on bottom window
+ let h0 = winheight(0)
+ for offset in range(5)
+ call assert_true(0->win_move_statusline(-offset))
+ call assert_equal(h0 - offset, winheight(0))
+ call assert_equal(1 + offset, &cmdheight)
+ call assert_true(win_move_statusline(0, offset))
+ call assert_equal(h0, winheight(0))
+ call assert_equal(1, &cmdheight)
+ endfor
+ call assert_true(win_move_statusline(0, 1))
+ call assert_equal(h0, winheight(0))
+ call assert_equal(1, &cmdheight)
" check win_move_statusline from bottom window on top window ID
let id = win_getid(1)
for offset in range(5)