diff src/testdir/test_match.vim @ 30570:86683eee58ac v9.0.0620

patch 9.0.0620: matchaddpos() can only add up to 8 matches Commit: https://github.com/vim/vim/commit/50faf02f43d7f1a56ec2023028fca7c72dbce83e Author: Bram Moolenaar <Bram@vim.org> Date: Thu Sep 29 12:50:17 2022 +0100 patch 9.0.0620: matchaddpos() can only add up to 8 matches Problem: matchaddpos() can only add up to 8 matches. Solution: Allocate the array of positions. (closes https://github.com/vim/vim/issues/11248)
author Bram Moolenaar <Bram@vim.org>
date Thu, 29 Sep 2022 14:00:09 +0200
parents adb0de8be4ce
children 66de6909e102
line wrap: on
line diff
--- a/src/testdir/test_match.vim
+++ b/src/testdir/test_match.vim
@@ -219,6 +219,21 @@ func Test_matchaddpos()
   set hlsearch&
 endfunc
 
+" Add 12 match positions (previously the limit was 8 positions).
+func Test_matchaddpos_dump()
+  CheckScreendump
+
+  let lines =<< trim END
+      call setline(1, ['1234567890123']->repeat(14))
+      call matchaddpos('Search', range(1, 12)->map({i, v -> [v, v]}))
+  END
+  call writefile(lines, 'Xmatchaddpos', 'D')
+  let buf = RunVimInTerminal('-S Xmatchaddpos', #{rows: 14})
+  call VerifyScreenDump(buf, 'Test_matchaddpos_1', {})
+
+  call StopVimInTerminal(buf)
+endfunc
+
 func Test_matchaddpos_otherwin()
   syntax on
   new