From ab505b1a4868b3e21356f95a275537551700c955 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 23 Mar 2020 19:28:44 +0100 Subject: [PATCH] patch 8.2.0432: a few tests fail in a huge terminal Problem: A few tests fail in a huge terminal. Solution: Make the tests pass. (Dominique Pelle, closes #5829) --- src/testdir/test_autocmd.vim | 6 +++--- src/testdir/test_options.vim | 3 +-- src/testdir/test_termcodes.vim | 22 +++++++++++++--------- src/testdir/test_terminal.vim | 5 ++--- src/testdir/test_window_cmd.vim | 4 ++-- src/version.c | 2 ++ 6 files changed, 23 insertions(+), 19 deletions(-) diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim index 02b56a73b..44f9465f0 100644 --- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -1967,12 +1967,12 @@ endfunc func Test_autocmd_bufreadpre() new let b:bufreadpre = 1 - call append(0, range(100)) + call append(0, range(1000)) w! XAutocmdBufReadPre.txt autocmd BufReadPre :let b:bufreadpre += 1 - norm! 50gg + norm! 500gg sp - norm! 100gg + norm! 1000gg wincmd p let g:wsv1 = winsaveview() wincmd p diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim index 5cae2720a..f5e0e9b14 100644 --- a/src/testdir/test_options.vim +++ b/src/testdir/test_options.vim @@ -396,8 +396,7 @@ endfunc func Test_set_one_column() let out_mult = execute('set all')->split("\n") let out_one = execute('set! all')->split("\n") - " one column should be two to four times as many lines - call assert_inrange(len(out_mult) * 2, len(out_mult) * 4, len(out_one)) + call assert_true(len(out_mult) < len(out_one)) endfunc func Test_set_values() diff --git a/src/testdir/test_termcodes.vim b/src/testdir/test_termcodes.vim index f27648eb5..13770c643 100644 --- a/src/testdir/test_termcodes.vim +++ b/src/testdir/test_termcodes.vim @@ -758,16 +758,20 @@ func Test_term_mouse_click_in_cmdline_to_set_pos() let row = &lines for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec - let msg = 'ttymouse=' .. ttymouse_val - exe 'set ttymouse=' .. ttymouse_val + " When 'ttymouse' is 'xterm2', row/col bigger than 223 are not supported. + if ttymouse_val !=# 'xterm2' || row <= 223 + let msg = 'ttymouse=' .. ttymouse_val + exe 'set ttymouse=' .. ttymouse_val - call feedkeys(':"3456789' - \ .. MouseLeftClickCode(row, 7) - \ .. MouseLeftReleaseCode(row, 7) .. 'L' - \ .. MouseRightClickCode(row, 4) - \ .. MouseRightReleaseCode(row, 4) .. 'R' - \ .. "\", 'Lx!') - call assert_equal('"3R456L789', @:, msg) + + call feedkeys(':"3456789' + \ .. MouseLeftClickCode(row, 7) + \ .. MouseLeftReleaseCode(row, 7) .. 'L' + \ .. MouseRightClickCode(row, 4) + \ .. MouseRightReleaseCode(row, 4) .. 'R' + \ .. "\", 'Lx!') + call assert_equal('"3R456L789', @:, msg) + endif endfor let &mouse = save_mouse diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim index f83ca51cb..6d7c78615 100644 --- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -673,7 +673,7 @@ func Test_terminal_noblock() let len = 5000 endif - for c in ['a','b','c','d','e','f','g','h','i','j','k'] + for c in split('abcdefghijklmnopqrstuvwxyz', '\zs') call term_sendkeys(buf, 'echo ' . repeat(c, len) . "\") endfor call term_sendkeys(buf, "echo done\") @@ -2495,7 +2495,7 @@ func Test_term_nasty_callback() func TermExit(...) call term_sendkeys(bufnr('#'), "exit\") call popup_close(win_getid()) - endfu + endfunc call OpenTerms() call term_sendkeys(g:buf0, "exit\") @@ -2503,4 +2503,3 @@ func Test_term_nasty_callback() exe g:buf0 .. 'bwipe!' set hidden& endfunc - diff --git a/src/testdir/test_window_cmd.vim b/src/testdir/test_window_cmd.vim index 1a676661c..040324d20 100644 --- a/src/testdir/test_window_cmd.vim +++ b/src/testdir/test_window_cmd.vim @@ -1013,13 +1013,13 @@ func Run_noroom_for_newwindow_test(dir_arg) let dir = (a:dir_arg == 'v') ? 'vert ' : '' " Open as many windows as possible - for i in range(500) + while v:true try exe dir . 'new' catch /E36:/ break endtry - endfor + endwhile call writefile(['first', 'second', 'third'], 'Xfile1') call writefile([], 'Xfile2') diff --git a/src/version.c b/src/version.c index dc29a85c9..236e6f73f 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 432, /**/ 431, /**/ -- 2.40.0