File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -145,5 +145,50 @@ Describe vsnip
145
145
146
146
End
147
147
148
+ Describe #completefunc
149
+
150
+ It should return start position
151
+ enew!
152
+ set filetype=basic_spec
153
+ call setline(1, ' if')
154
+ call cursor([1, 3])
155
+ call s:expect(vsnip#completefunc(1, '')).to_equal(1)
156
+ End
157
+
158
+ It should return complete items
159
+ enew!
160
+ set filetype=basic_spec
161
+ call s:expect(vsnip#completefunc(0, 'if')[-1]).to_equal({
162
+ \ 'word': 'if',
163
+ \ 'abbr': 'if',
164
+ \ 'kind': 'Snippet',
165
+ \ 'menu': '[v] if',
166
+ \ 'dup': 1,
167
+ \ 'user_data': json_encode({
168
+ \ 'vsnip': {
169
+ \ 'snippet': [
170
+ \ "if ${1:condition}",
171
+ \ "\t$0",
172
+ \ "endif",
173
+ \ ]
174
+ \ }
175
+ \ })
176
+ \ }, {
177
+ \ 'word': 'inline-fn',
178
+ \ 'abbr': 'inline-fn',
179
+ \ 'kind': 'Snippet',
180
+ \ 'menu': '[v] inline-fn',
181
+ \ 'dup': 1,
182
+ \ 'user_data': json_encode({
183
+ \ 'vsnip': {
184
+ \ 'snippet': [
185
+ \ "{ -> $1 }$0"
186
+ \ ]
187
+ \ }
188
+ \ })
189
+ \ })
190
+ End
191
+ End
192
+
148
193
End
149
194
You can’t perform that action at this time.
0 commit comments