blob: db7ebe21697043154c00e2246546bf6b0cc65bec [file] [log] [blame]
Bram Moolenaarbf55e142010-11-16 11:32:01 +01001Tests for completefunc/omnifunc. vim: set ft=vim :
2
3STARTTEST
4:"Test that nothing happens if the 'completefunc' opens
5:"a new window (no completion, no crash)
6:so small.vim
7:function! DummyCompleteOne(findstart, base)
8: if a:findstart
9: return 0
10: else
11: wincmd n
12: return ['onedef', 'oneDEF']
13: endif
14:endfunction
15:setlocal completefunc=DummyCompleteOne
16/^one
17A:q!
18:function! DummyCompleteTwo(findstart, base)
19: if a:findstart
20: wincmd n
21: return 0
22: else
23: return ['twodef', 'twoDEF']
24: endif
25:endfunction
26:setlocal completefunc=DummyCompleteTwo
27/^two
28A:q!
29:"Test that 'completefunc' works when it's OK.
30:function! DummyCompleteThree(findstart, base)
31: if a:findstart
32: return 0
33: else
34: return ['threedef', 'threeDEF']
35: endif
36:endfunction
37:setlocal completefunc=DummyCompleteThree
38/^three
39A:/^+++/,/^three/w! test.out
40:qa!
41ENDTEST
42
43+++
44one
45two
46three