comparison src/testdir/test_window_cmd.vim @ 22073:28b302ccfe21 v8.2.1586

patch 8.2.1586: :resize command not fully tested Commit: https://github.com/vim/vim/commit/fe6dce873954a216eedb686bd5006710ffff4b89 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Sep 4 14:41:21 2020 +0200 patch 8.2.1586: :resize command not fully tested Problem: :resize command not fully tested. Solution: Add a couple of tests. (Dominique Pell?, closes https://github.com/vim/vim/issues/6857)
author Bram Moolenaar <Bram@vim.org>
date Fri, 04 Sep 2020 14:45:05 +0200
parents 08940efa6b4e
children ff21e2962490
comparison
equal deleted inserted replaced
22072:1e7be9a17449 22073:28b302ccfe21
1104 call assert_beeps("normal \<C-W>K") 1104 call assert_beeps("normal \<C-W>K")
1105 call assert_beeps("normal \<C-W>H") 1105 call assert_beeps("normal \<C-W>H")
1106 call assert_beeps("normal \<C-W>2gt") 1106 call assert_beeps("normal \<C-W>2gt")
1107 endfunc 1107 endfunc
1108 1108
1109 func Test_window_resize()
1110 " Vertical :resize (absolute, relative, min and max size).
1111 vsplit
1112 vert resize 8
1113 call assert_equal(8, winwidth(0))
1114 vert resize +2
1115 call assert_equal(10, winwidth(0))
1116 vert resize -2
1117 call assert_equal(8, winwidth(0))
1118 vert resize
1119 call assert_equal(&columns - 2, winwidth(0))
1120 vert resize 0
1121 call assert_equal(1, winwidth(0))
1122 vert resize 99999
1123 call assert_equal(&columns - 2, winwidth(0))
1124
1125 %bwipe!
1126
1127 " Horizontal :resize (with absolute, relative size, min and max size).
1128 split
1129 resize 8
1130 call assert_equal(8, winheight(0))
1131 resize +2
1132 call assert_equal(10, winheight(0))
1133 resize -2
1134 call assert_equal(8, winheight(0))
1135 resize
1136 call assert_equal(&lines - 4, winheight(0))
1137 resize 0
1138 call assert_equal(1, winheight(0))
1139 resize 99999
1140 call assert_equal(&lines - 4, winheight(0))
1141
1142 " :resize with explicit window number.
1143 let other_winnr = winnr('j')
1144 exe other_winnr .. 'resize 10'
1145 call assert_equal(10, winheight(other_winnr))
1146 call assert_equal(&lines - 10 - 3, winheight(0))
1147
1148 %bwipe!
1149 endfunc
1150
1109 " Test for adjusting the window width when a window is closed with some 1151 " Test for adjusting the window width when a window is closed with some
1110 " windows using 'winfixwidth' 1152 " windows using 'winfixwidth'
1111 func Test_window_width_adjust() 1153 func Test_window_width_adjust()
1112 only 1154 only
1113 " Three vertical windows. Windows 1 and 2 have 'winfixwidth' set and close 1155 " Three vertical windows. Windows 1 and 2 have 'winfixwidth' set and close