]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/test_function_arg_count.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Do not set EDITOR/VISUAL for shell
[etc/vim.git] / .vim / bundle / ale / test / test_function_arg_count.vader
1 Before:
2   function! Func0()
3   endfunction
4   function! Func1(x)
5   endfunction
6   function! Func2(x,y)
7   endfunction
8   function! Func3(x,y,z)
9   endfunction
10   function! Func3a(x,y,z,...)
11   endfunction
12
13 After:
14   delfunction Func0
15   delfunction Func1
16   delfunction Func2
17   delfunction Func3
18   delfunction Func3a
19
20 Execute(We should be able to compute the argument count for function names):
21   AssertEqual 0, ale#util#FunctionArgCount('Func0')
22   AssertEqual 1, ale#util#FunctionArgCount('Func1')
23   AssertEqual 2, ale#util#FunctionArgCount('Func2')
24   AssertEqual 3, ale#util#FunctionArgCount('Func3')
25   AssertEqual 3, ale#util#FunctionArgCount('Func3a')
26
27 Execute(We should be able to compute the argument count for Funcrefs):
28   AssertEqual 0, ale#util#FunctionArgCount(function('Func0'))
29   AssertEqual 1, ale#util#FunctionArgCount(function('Func1'))
30   AssertEqual 2, ale#util#FunctionArgCount(function('Func2'))
31   AssertEqual 3, ale#util#FunctionArgCount(function('Func3'))
32   AssertEqual 3, ale#util#FunctionArgCount(function('Func3a'))
33
34 Execute(We should be able to compute the argument count for lambdas):
35   if has('lambda')
36     AssertEqual 0, ale#util#FunctionArgCount({->1})
37     AssertEqual 1, ale#util#FunctionArgCount({x->1})
38     AssertEqual 2, ale#util#FunctionArgCount({x,y->1})
39     AssertEqual 3, ale#util#FunctionArgCount({x,y,z->1})
40     AssertEqual 3, ale#util#FunctionArgCount({x,y,z,...->1})
41   endif
42
43 Execute(We should be able to compute the argument count autoload functions not yet loaded):
44   AssertEqual 1, ale#util#FunctionArgCount(function('ale#fixers#yapf#Fix'))
45   AssertEqual 1, ale#util#FunctionArgCount('ale#fixers#yapf#Fix')