From 3c6eb9871a9a7423e57f5c47e090457b26b6407b Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Wed, 8 Aug 2018 21:47:35 -0400 Subject: vim-patch:8.0.1004: matchstrpos() without a match returns too many items Problem: Matchstrpos() without a match returns too many items. Solution: Also remove the second item when the position is beyond the end of the string. (Hirohito Higashi) Use an enum for the type. https://github.com/vim/vim/commit/8d9f0ef5c6a6f6d19c3d02690e1ee347a70b8452 --- src/nvim/testdir/test_match.vim | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/nvim/testdir/test_match.vim') diff --git a/src/nvim/testdir/test_match.vim b/src/nvim/testdir/test_match.vim index 066bb2f6a1..5602724b7d 100644 --- a/src/nvim/testdir/test_match.vim +++ b/src/nvim/testdir/test_match.vim @@ -152,13 +152,10 @@ endfunc func Test_matchstrpos() call assert_equal(['ing', 4, 7], matchstrpos('testing', 'ing')) - call assert_equal(['ing', 4, 7], matchstrpos('testing', 'ing', 2)) - call assert_equal(['', -1, -1], matchstrpos('testing', 'ing', 5)) - + call assert_equal(['', -1, -1], matchstrpos('testing', 'ing', 8)) call assert_equal(['ing', 1, 4, 7], matchstrpos(['vim', 'testing', 'execute'], 'ing')) - call assert_equal(['', -1, -1, -1], matchstrpos(['vim', 'testing', 'execute'], 'img')) endfunc -- cgit From fe6cf2812b819297602ce355f8cfea157d64e110 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Wed, 8 Aug 2018 22:37:07 -0400 Subject: vim-patch:8.0.1105: match() and matchend() are not tested Problem: match() and matchend() are not tested. Solution: Add tests. (Ozaki Kiichi, closes vim/vim#2088) https://github.com/vim/vim/commit/1190cf68e27a123cf9f6fb57897782a3b9f7b810 --- src/nvim/testdir/test_match.vim | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src/nvim/testdir/test_match.vim') diff --git a/src/nvim/testdir/test_match.vim b/src/nvim/testdir/test_match.vim index 5602724b7d..e608a2e58b 100644 --- a/src/nvim/testdir/test_match.vim +++ b/src/nvim/testdir/test_match.vim @@ -1,5 +1,5 @@ " Test for :match, :2match, :3match, clearmatches(), getmatches(), matchadd(), -" matchaddpos(), matcharg(), matchdelete(), matchstrpos() and setmatches(). +" matchaddpos(), matcharg(), matchdelete(), and setmatches(). function Test_match() highlight MyGroup1 term=bold ctermbg=red guibg=red @@ -150,15 +150,6 @@ function Test_match() highlight MyGroup3 NONE endfunc -func Test_matchstrpos() - call assert_equal(['ing', 4, 7], matchstrpos('testing', 'ing')) - call assert_equal(['ing', 4, 7], matchstrpos('testing', 'ing', 2)) - call assert_equal(['', -1, -1], matchstrpos('testing', 'ing', 5)) - call assert_equal(['', -1, -1], matchstrpos('testing', 'ing', 8)) - call assert_equal(['ing', 1, 4, 7], matchstrpos(['vim', 'testing', 'execute'], 'ing')) - call assert_equal(['', -1, -1, -1], matchstrpos(['vim', 'testing', 'execute'], 'img')) -endfunc - func Test_matchaddpos() syntax on set hlsearch -- cgit