" Test maparg() compatibility. call vimtest#SkipAndQuitIf(v:version < 704, 'Need support for extended maparg().rhs') " Cannot use the one from helpers/CompatChecker.vim because we need to pass " additional arguments to the original maparg() one here, and use the rhs " attribute from the result. function! IsCompatible( originalFunctionName, description, ... ) let l:expected = call(a:originalFunctionName, [a:1, '', 0, 1]).rhs let l:got = call('ingo#compat#maparg', a:000) call vimtap#Is(l:got, l:expected, a:description) endfunction let g:IngoLibrary_CompatFor = 'maparg' call vimtest#StartTap() call vimtap#Plan(6) nnoremap TestEasy simple call IsCompatible('maparg', 'simple mapping', 'TestEasy') nnoremap TestKeyNotation :echo call IsCompatible('maparg', 'key notation', 'TestKeyNotation') nnoremap TestBar :echo "foo"version quit call IsCompatible('maparg', 'bar', 'TestBar') nnoremap TestLt echo "\Plug>NONO" call IsCompatible('maparg', '', 'TestLt') nnoremap (JustATest) gaga nnoremap TestSID :(JustATest): call vimtap#Is(maparg('TestSID', '', 0, 1).rhs, ':(JustATest):', 'original does not resolve ') call vimtap#Like(ingo#compat#maparg('TestSID'), '^:\d\+_(JustATest):$', 'compatibility wrapper resolves to ') call vimtest#Quit()