]> git.madduck.net Git - etc/vim.git/blob - test/test_parse_command_args.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:

Squashed '.vim/bundle/ale/' content from commit 22185c4c
[etc/vim.git] / test / test_parse_command_args.vader
1 After:
2   unlet! b:parse_result
3
4   if exists(':ParseTest')
5     delcommand ParseTest
6   endif
7
8 Execute(ale#args#Parse should work for an example command):
9   command! -nargs=* ParseTest let b:parse_result = ale#args#Parse(['foo', 'bar'], <q-args>)
10
11   ParseTest
12   AssertEqual [{}, ''], b:parse_result
13
14   ParseTest --
15   AssertEqual [{}, ''], b:parse_result
16
17   ParseTest -foo
18   AssertEqual [{'foo': ''}, ''], b:parse_result
19
20   ParseTest -foo -- --
21   AssertEqual [{'foo': ''}, '--'], b:parse_result
22
23   ParseTest -foo -bar
24   AssertEqual [{'foo': '', 'bar': ''}, ''], b:parse_result
25
26   ParseTest -foo -bar leave  these  alone
27   AssertEqual [{'foo': '', 'bar': ''}, 'leave  these  alone'], b:parse_result
28
29 Execute(ale#args#Parse should raise errors for unknown arguments):
30   AssertThrows call ale#args#Parse(['foo', 'bar'], '-nope   leave  these  alone')
31   AssertEqual 'Invalid argument: -nope', g:vader_exception