mirror of
https://github.com/inkarkat/vim-ingo-library.git
synced 2026-05-29 11:18:51 +02:00
16 lines
547 B
VimL
16 lines
547 B
VimL
" Test maximum attempts for unique return values.
|
|
|
|
function! TestFunction()
|
|
return remove(s:values, 0)
|
|
endfunction
|
|
|
|
call vimtest#StartTap()
|
|
call vimtap#Plan(2)
|
|
|
|
let s:values = [1, 1, 1, 1, 5]
|
|
call ingo#function#uniquify#SetMaxAttempts('t1', 3)
|
|
call vimtap#Is(ingo#function#uniquify#ReturnValue('t1', 'TestFunction'), 1, 't1 1.')
|
|
call vimtap#err#Throws('ReturnValue: Too many invocations with same return value: 3', 'call ingo#function#uniquify#ReturnValue("t1", "TestFunction")', 'Unique value only after fourth attempt')
|
|
|
|
call vimtest#Quit()
|