comparison 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
comparison
equal deleted inserted replaced
29681:b766ffb853c0 29682:57cfb39b7842
920 new 920 new
921 setlocal ff=unix 921 setlocal ff=unix
922 if a:add_props 922 if a:add_props
923 call prop_type_add('textprop', #{highlight: 'Search'}) 923 call prop_type_add('textprop', #{highlight: 'Search'})
924 endif 924 endif
925 " Add a text prop to every fourth line and then change every fifth line so
926 " that it causes a data block split a few times.
925 for nr in range(1, 1000) 927 for nr in range(1, 1000)
926 call setline(nr, 'some longer text here') 928 call setline(nr, 'some longer text here')
927 if a:add_props && nr % 17 == 0 929 if a:add_props && nr % 4 == 0
928 call prop_add(nr, 13, #{type: 'textprop', length: 4}) 930 call prop_add(nr, 13, #{type: 'textprop', length: 4})
929 endif 931 endif
930 endfor 932 endfor
931 call assert_equal(21935, line2byte(998)) 933 let expected = 22 * 997 + 1
932 for nr in range(1, 1000, 7) 934 call assert_equal(expected, line2byte(998))
935
936 for nr in range(1, 1000, 5)
933 exe nr .. "s/longer/much more/" 937 exe nr .. "s/longer/much more/"
938 let expected += 3
939 call assert_equal(expected, line2byte(998), 'line ' .. nr)
934 endfor 940 endfor
935 " FIXME: somehow this fails on MS-Windows
936 if !(a:add_props && has('win32'))
937 call assert_equal(22364, line2byte(998))
938 endif
939 941
940 if a:add_props 942 if a:add_props
941 call prop_type_delete('textprop') 943 call prop_type_delete('textprop')
942 endif 944 endif
943 bwipe! 945 bwipe!