changeset 19752:0927df746554 v8.2.0432

patch 8.2.0432: a few tests fail in a huge terminal Commit: https://github.com/vim/vim/commit/ab505b1a4868b3e21356f95a275537551700c955 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Mar 23 19:28:44 2020 +0100 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 https://github.com/vim/vim/issues/5829)
author Bram Moolenaar <Bram@vim.org>
date Mon, 23 Mar 2020 19:30:06 +0100
parents 4bed205e29d9
children cf2885e38afd
files src/testdir/test_autocmd.vim src/testdir/test_options.vim src/testdir/test_termcodes.vim src/testdir/test_terminal.vim src/testdir/test_window_cmd.vim src/version.c
diffstat 6 files changed, 23 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- 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 <buffer> :let b:bufreadpre += 1
-  norm! 50gg
+  norm! 500gg
   sp
-  norm! 100gg
+  norm! 1000gg
   wincmd p
   let g:wsv1 = winsaveview()
   wincmd p
--- 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()
--- a/src/testdir/test_termcodes.vim
+++ b/src/testdir/test_termcodes.vim
@@ -758,16 +758,20 @@ func Test_term_mouse_click_in_cmdline_to
   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'
-          \       .. "\<CR>", 'Lx!')
-    call assert_equal('"3R456L789', @:, msg)
+      call feedkeys(':"3456789'
+            \       .. MouseLeftClickCode(row, 7)
+            \       .. MouseLeftReleaseCode(row, 7) .. 'L'
+            \       .. MouseRightClickCode(row, 4)
+            \       .. MouseRightReleaseCode(row, 4) .. 'R'
+            \       .. "\<CR>", 'Lx!')
+      call assert_equal('"3R456L789', @:, msg)
+    endif
   endfor
 
   let &mouse = save_mouse
--- 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) . "\<cr>")
   endfor
   call term_sendkeys(buf, "echo done\<cr>")
@@ -2495,7 +2495,7 @@ func Test_term_nasty_callback()
   func TermExit(...)
     call term_sendkeys(bufnr('#'), "exit\<CR>")
     call popup_close(win_getid())
-  endfu
+  endfunc
   call OpenTerms()
 
   call term_sendkeys(g:buf0, "exit\<CR>")
@@ -2503,4 +2503,3 @@ func Test_term_nasty_callback()
   exe g:buf0 .. 'bwipe!'
   set hidden&
 endfunc
-
--- 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_a
   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')
--- a/src/version.c
+++ b/src/version.c
@@ -739,6 +739,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    432,
+/**/
     431,
 /**/
     430,