]> git.madduck.net Git - etc/vim.git/blob - test/completion/test_public_completion_api.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 / completion / test_public_completion_api.vader
1 Before:
2   call ale#linter#Reset()
3
4   unlet! b:ale_linters
5   unlet! b:ale_completion_info
6   unlet! b:ale_completion_result
7
8 After:
9   call ale#linter#Reset()
10
11   unlet! b:ale_linters
12   unlet! b:ale_completion_info
13   unlet! b:ale_completion_result
14
15 Execute(ale#completion#GetCompletionResult() should return v:null when there are no results):
16   AssertEqual v:null, ale#completion#GetCompletionResult()
17
18 Execute(ale#completion#GetCompletionResult() should return a result computed previously):
19   let b:ale_completion_result = [1]
20
21   AssertEqual [1], ale#completion#GetCompletionResult()
22
23 Execute(ale#completion#GetCompletionPosition() should return 0 when there is no completion information):
24   AssertEqual 0, ale#completion#GetCompletionPosition()
25
26 Given python(Some Python file):
27   foo bar
28
29 Execute(ale#completion#GetCompletionPosition() should return the position in the file when information is available):
30   let b:ale_completion_info = {'line': 1, 'column': 6}
31
32   " This is the first character of 'bar'
33   AssertEqual 4, ale#completion#GetCompletionPosition()
34
35 Execute(ale#completion#GetCompletionPositionForDeoplete() should return the position on the given input string):
36   " This is the first character of 'bar'
37   AssertEqual 4, ale#completion#GetCompletionPositionForDeoplete('foo bar')
38
39 Execute(ale#completion#CanProvideCompletions should return 0 when no completion sources are available):
40   let b:ale_linters = ['flake8']
41   AssertEqual 0, ale#completion#CanProvideCompletions()
42
43 Execute(ale#completion#CanProvideCompletions should return 1 when at least one completion source is available):
44   runtime ale_linters/python/pylsp.vim
45   let b:ale_linters = ['pylsp']
46
47   AssertEqual 1, ale#completion#CanProvideCompletions()