forked from aniani/vim
Problem: There is no easy way to get all the information about a match. Solution: Add matchstrpos(). (Ozaki Kiichi)
14 lines
437 B
VimL
14 lines
437 B
VimL
" 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
|