comparison src/testdir/test_window_cmd.vim @ 27440:1118a65c9bc7

patch 8.2.4248: no proper test for moving the window separator Commit: https://github.com/vim/vim/commit/a0c4e2f2d7aa164d9d7692702c752ea063bd3a8c Author: zeertzjq <zeertzjq@outlook.com> Date: Sat Jan 29 10:59:53 2022 +0000 patch 8.2.4248: no proper test for moving the window separator Problem: No proper test for moving the window separator. Solution: Add a test. Add comment in code. (closes https://github.com/vim/vim/issues/9656)
author Bram Moolenaar <Bram@vim.org>
date Sat, 29 Jan 2022 12:00:06 +0100
parents b94cdb5ef20e
children cdaff4db7760
comparison
equal deleted inserted replaced
27439:996b7602c7fa 27440:1118a65c9bc7
1422 call assert_true(win_move_separator(id, offset)) 1422 call assert_true(win_move_separator(id, offset))
1423 call assert_equal(w + offset, winwidth(id)) 1423 call assert_equal(w + offset, winwidth(id))
1424 call assert_true(id->win_move_separator(-offset)) 1424 call assert_true(id->win_move_separator(-offset))
1425 call assert_equal(w, winwidth(id)) 1425 call assert_equal(w, winwidth(id))
1426 endfor 1426 endfor
1427 " check win_move_separator from right window on right window is no-op
1428 let w0 = winwidth(0)
1429 call assert_true(win_move_separator(0, 1))
1430 call assert_equal(w0, winwidth(0))
1431 call assert_true(win_move_separator(0, -1))
1432 call assert_equal(w0, winwidth(0))
1427 " check that win_move_separator doesn't error with offsets beyond moving 1433 " check that win_move_separator doesn't error with offsets beyond moving
1428 " possibility 1434 " possibility
1429 call assert_true(win_move_separator(id, 5000)) 1435 call assert_true(win_move_separator(id, 5000))
1430 call assert_true(winwidth(id) > w) 1436 call assert_true(winwidth(id) > w)
1431 call assert_true(win_move_separator(id, -5000)) 1437 call assert_true(win_move_separator(id, -5000))
1463 call assert_true(1->win_move_statusline(offset)) 1469 call assert_true(1->win_move_statusline(offset))
1464 call assert_equal(h + offset, winheight(1)) 1470 call assert_equal(h + offset, winheight(1))
1465 call assert_true(win_move_statusline(1, -offset)) 1471 call assert_true(win_move_statusline(1, -offset))
1466 call assert_equal(h, winheight(1)) 1472 call assert_equal(h, winheight(1))
1467 endfor 1473 endfor
1474 " check win_move_statusline from bottom window on bottom window
1475 let h0 = winheight(0)
1476 for offset in range(5)
1477 call assert_true(0->win_move_statusline(-offset))
1478 call assert_equal(h0 - offset, winheight(0))
1479 call assert_equal(1 + offset, &cmdheight)
1480 call assert_true(win_move_statusline(0, offset))
1481 call assert_equal(h0, winheight(0))
1482 call assert_equal(1, &cmdheight)
1483 endfor
1484 call assert_true(win_move_statusline(0, 1))
1485 call assert_equal(h0, winheight(0))
1486 call assert_equal(1, &cmdheight)
1468 " check win_move_statusline from bottom window on top window ID 1487 " check win_move_statusline from bottom window on top window ID
1469 let id = win_getid(1) 1488 let id = win_getid(1)
1470 for offset in range(5) 1489 for offset in range(5)
1471 call assert_true(win_move_statusline(id, offset)) 1490 call assert_true(win_move_statusline(id, offset))
1472 call assert_equal(h + offset, winheight(id)) 1491 call assert_equal(h + offset, winheight(id))