patch 8.1.0276: no test for 'incsearch' highlighting with :s v8.1.0276
authorBram Moolenaar <Bram@vim.org>
Sun, 12 Aug 2018 14:26:58 +0000 (16:26 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 12 Aug 2018 14:26:58 +0000 (16:26 +0200)
Problem:    No test for 'incsearch' highlighting with :s.
Solution:   Add a screendump test.

src/testdir/dumps/Test_incsearch_substitute_01.dump [new file with mode: 0644]
src/testdir/test_search.vim
src/version.c

diff --git a/src/testdir/dumps/Test_incsearch_substitute_01.dump b/src/testdir/dumps/Test_incsearch_substitute_01.dump
new file mode 100644 (file)
index 0000000..63886f5
--- /dev/null
@@ -0,0 +1,9 @@
+|f+0&#ffffff0|o@1| |1| @64
+|f|o@1| |2| @64
+|f+1&&|o@1| +0&&|3| @64
+|f+0&#ffff4012|o@1| +0&#ffffff0|4| @64
+|f+0&#ffff4012|o@1| +0&#ffffff0|5| @64
+|f|o@1| |6| @64
+|f|o@1| |7| @64
+|f|o@1| |8| @64
+|:|.|,|.|+|2|s|/|f|o@1> @58
index ac5b228df3c5db5b74d05fa5f94a9d3565dae1d6..20ffa0fbffc05ab1d22a096151f54343fddcd9d3 100644 (file)
@@ -818,6 +818,41 @@ func Test_incsearch_substitute()
   call Incsearch_cleanup()
 endfunc
 
+" Similar to Test_incsearch_substitute() but with a screendump halfway.
+func Test_incsearch_substitute_dump()
+  if !exists('+incsearch')
+    return
+  endif
+  if !CanRunVimInTerminal()
+    return
+  endif
+  call writefile([
+       \ 'set incsearch hlsearch scrolloff=0',
+       \ 'for n in range(1, 10)',
+       \ '  call setline(n, "foo " . n)',
+       \ 'endfor',
+       \ '3',
+       \ ], 'Xis_subst_script')
+  let buf = RunVimInTerminal('-S Xis_subst_script', {'rows': 9, 'cols': 70})
+  " Give Vim a chance to redraw to get rid of the spaces in line 2 caused by
+  " the 'ambiwidth' check.
+  sleep 100m
+
+  " Need to send one key at a time to force a redraw.
+  call term_sendkeys(buf, ':.,.+2s/')
+  sleep 100m
+  call term_sendkeys(buf, 'f')
+  sleep 100m
+  call term_sendkeys(buf, 'o')
+  sleep 100m
+  call term_sendkeys(buf, 'o')
+  call VerifyScreenDump(buf, 'Test_incsearch_substitute_01', {})
+
+  call term_sendkeys(buf, "\<Esc>")
+  call StopVimInTerminal(buf)
+  call delete('Xis_subst_script')
+endfunc
+
 func Test_search_undefined_behaviour()
   if !has("terminal")
     return
index a8262a7ce89a4629ad59522341f40946b39887b4..98b233588f2d158a1025c03b348f98b97bcca065 100644 (file)
@@ -794,6 +794,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    276,
 /**/
     275,
 /**/