vim-patch:9.0.1667: regression test doesn't fail when fix is reverted

Problem:    Regression test doesn't fail when fix is reverted.
Solution:   Add "n" to 'cpoptions' instead of using :winsize. (closes vim/vim#12587,
            issue vim/vim#12528)

e429893741
This commit is contained in:
zeertzjq 2023-06-27 08:22:21 +08:00
parent 3b6fb3fefd
commit 116b09ac04
2 changed files with 26 additions and 27 deletions

View File

@ -941,16 +941,17 @@ describe('smoothscroll', function()
-- oldtest: Test_smoothscroll_zero_width_scroll_cursor_bot() -- oldtest: Test_smoothscroll_zero_width_scroll_cursor_bot()
it('does not divide by zero in zero-width window', function() it('does not divide by zero in zero-width window', function()
screen:try_resize(12, 19) screen:try_resize(40, 19)
screen:set_default_attr_ids({ screen:set_default_attr_ids({
[1] = {foreground = Screen.colors.Brown}; -- LineNr [1] = {foreground = Screen.colors.Brown}; -- LineNr
[2] = {bold = true, reverse = true}; -- StatusLine [2] = {bold = true, foreground = Screen.colors.Blue}; -- NonText
[3] = {reverse = true}; -- StatusLineNC [3] = {bold = true, reverse = true}; -- StatusLine
[4] = {reverse = true}; -- StatusLineNC
}) })
exec([[ exec([[
silent normal yy silent normal yy
silent normal 19p silent normal 19p
winsize 0 19 set cpoptions+=n
vsplit vsplit
vertical resize 0 vertical resize 0
set foldcolumn=1 set foldcolumn=1
@ -959,25 +960,25 @@ describe('smoothscroll', function()
silent normal 20G silent normal 20G
]]) ]])
screen:expect([[ screen:expect([[
{1: } | {1: } |
{1: } | {2:@} |
{1: } | {2:@} |
{1: } | {2:@} |
{1: } | {2:@} |
{1: } | {2:@} |
{1: } | {2:@} |
{1: } | {2:@} |
{1: } | {2:@} |
{1: } | {2:@} |
{1: } | {2:@} |
{1: } | {2:@} |
{1: } | {2:@} |
{1: } | {2:@} |
{1: } | {2:@} |
{1: } | {2:@} |
{1:^ } | {2:^@} |
{2:< }{3:<ame] [+] }| {3:< }{4:[No Name] [+] }|
| |
]]) ]])
end) end)

View File

@ -843,7 +843,7 @@ func Test_smoothscroll_zero_width_scroll_cursor_bot()
let lines =<< trim END let lines =<< trim END
silent normal yy silent normal yy
silent normal 19p silent normal 19p
winsize 0 19 set cpoptions+=n
vsplit vsplit
vertical resize 0 vertical resize 0
set foldcolumn=1 set foldcolumn=1
@ -852,9 +852,7 @@ func Test_smoothscroll_zero_width_scroll_cursor_bot()
silent normal 20G silent normal 20G
END END
call writefile(lines, 'XSmoothScrollZeroBot', 'D') call writefile(lines, 'XSmoothScrollZeroBot', 'D')
let buf = RunVimInTerminal('-u NONE -S XSmoothScrollZeroBot', #{rows: 19, wait_for_ruler: 0}) let buf = RunVimInTerminal('-u NONE -S XSmoothScrollZeroBot', #{rows: 19})
call TermWait(buf, 1000)
call VerifyScreenDump(buf, 'Test_smoothscroll_zero_bot', {}) call VerifyScreenDump(buf, 'Test_smoothscroll_zero_bot', {})
call StopVimInTerminal(buf) call StopVimInTerminal(buf)