Commits

ZyX_I  committed 060f159

Added wrapfunc test

  • Participants
  • Parent commits 535e37e

Comments (0)

Files changed (2)

File test/rtp/plugin/wrapfunc.vim

+execute frawor#Setup('0.0', {'plugin/frawor/functions': '0.0'}, 1)
+function s:F.wrappedfunc()
+    call WriteFile('funcbefore:b'.bufnr('%'))
+    new
+    call WriteFile('funcafter:b'.bufnr('%'))
+endfunction
+function s:F.checker(args)
+    call WriteFile('checkerbefore:b'.bufnr('%'))
+    new
+    call WriteFile('checkerafter:b'.bufnr('%'))
+    return empty(a:args)
+endfunction
+function s:F.filter(args)
+    call WriteFile('filterbefore:b'.bufnr('%'))
+    new
+    call WriteFile('filterafter:b'.bufnr('%'))
+    return empty(a:args) ? a:args : 0
+endfunction
+call s:F._frawor.addextfunctions({'Function': {'function': s:F.wrappedfunc,
+            \                                   'checker': s:F.checker,
+            \                                    'filter': s:F.filter,
+            \                                 'altervars': [['+buffer']]}})
+call WriteFile('start:b'.bufnr('%'))
+call Function()
+call WriteFile('end:b'.bufnr('%'))
+call Function(0)

File test/wrapfunc.in

+:let &rtp.=",".escape($TESTDIR, ',\').'/rtp'
+:let g:testfile="plugin/".g:curtest.".vim"
+:source test.vim