diff src/testdir/test_textprop.vim @ 29682:57cfb39b7842 v9.0.0181

patch 9.0.0181: textprop test with line2byte() fails on MS-Windows Commit: https://github.com/vim/vim/commit/e5a0e8c1d781aa3781b4f6167fc2cba1193213f1 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Aug 9 21:37:55 2022 +0100 patch 9.0.0181: textprop test with line2byte() fails on MS-Windows Problem: Textprop test with line2byte() fails on MS-Windows. Solution: Fix updating chuncks in ml_delete_int().
author Bram Moolenaar <Bram@vim.org>
date Tue, 09 Aug 2022 22:45:03 +0200
parents 955026042e45
children 4153e4815b36
line wrap: on
line diff
--- a/src/testdir/test_textprop.vim
+++ b/src/testdir/test_textprop.vim
@@ -922,20 +922,22 @@ func Run_test_with_line2byte(add_props)
   if a:add_props
     call prop_type_add('textprop', #{highlight: 'Search'})
   endif
+  " Add a text prop to every fourth line and then change every fifth line so
+  " that it causes a data block split a few times.
   for nr in range(1, 1000)
     call setline(nr, 'some longer text here')
-    if a:add_props && nr % 17 == 0
+    if a:add_props && nr % 4 == 0
       call prop_add(nr, 13, #{type: 'textprop', length: 4})
     endif
   endfor
-  call assert_equal(21935, line2byte(998))
-  for nr in range(1, 1000, 7)
+  let expected = 22 * 997 + 1
+  call assert_equal(expected, line2byte(998))
+
+  for nr in range(1, 1000, 5)
     exe nr .. "s/longer/much more/"
+    let expected += 3
+    call assert_equal(expected, line2byte(998), 'line ' .. nr)
   endfor
-  " FIXME: somehow this fails on MS-Windows
-  if !(a:add_props && has('win32'))
-    call assert_equal(22364, line2byte(998))
-  endif
 
   if a:add_props
     call prop_type_delete('textprop')