mirror of
https://github.com/neovim/neovim.git
synced 2026-02-12 23:42:19 +10:00
vim-patch:7.4.1685
Problem: There is no easy way to get all the information about a match.
Solution: Add matchstrpos(). (Ozaki Kiichi)
7fed5c18f8
This commit is contained in:
@@ -9,6 +9,7 @@ source test_expr.vim
|
||||
source test_expr_utf8.vim
|
||||
source test_feedkeys.vim
|
||||
source test_goto.vim
|
||||
source test_matchstrpos.vim
|
||||
source test_menu.vim
|
||||
source test_messages.vim
|
||||
source test_options.vim
|
||||
|
||||
13
src/nvim/testdir/test_matchstrpos.vim
Normal file
13
src/nvim/testdir/test_matchstrpos.vim
Normal file
@@ -0,0 +1,13 @@
|
||||
" Test matchstrpos
|
||||
|
||||
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(['ing', 1, 4, 7], matchstrpos(['vim', 'testing', 'execute'], 'ing'))
|
||||
|
||||
call assert_equal(['', -1, -1, -1], matchstrpos(['vim', 'testing', 'execute'], 'img'))
|
||||
endfunc
|
||||
Reference in New Issue
Block a user