mirror of
https://github.com/inkarkat/vim-ingo-library.git
synced 2026-05-29 11:18:51 +02:00
15 lines
522 B
VimL
15 lines
522 B
VimL
" Test AllMatches.
|
|
|
|
call vimtest#StartTap()
|
|
call vimtap#Plan(3)
|
|
|
|
call vimtap#Is(ingo#list#pattern#AllMatches(['foo', 'fox', 'fozzy'], 'o[^o]'), ['fox', 'fozzy'], 'return two matches')
|
|
call vimtap#Is(ingo#list#pattern#AllMatches(['foo', 'fox', 'fozzy'], 'noMatch'), [], 'no matches return empty List')
|
|
|
|
let s:list = ['foo', 'fox', 'fozzy']
|
|
let s:inputList = copy(s:list)
|
|
call ingo#list#pattern#AllMatches(s:inputList, 'o[^o]')
|
|
call vimtap#Is(s:inputList, s:list, 'the original List is left untouched')
|
|
|
|
call vimtest#Quit()
|