I broke up with neovim....vim is my best friend now

This commit is contained in:
LinlyBoi
2023-04-30 08:14:07 +03:00
parent 0d185449c5
commit 4a4a6b1e81
5245 changed files with 468325 additions and 25 deletions

View File

@@ -0,0 +1,97 @@
let s:expect = themis#helper('expect')
Describe vsnip#source
Describe #filetypes
It should return all filetype
enew!
set filetype=javascript.jsx
call s:expect(vsnip#source#filetypes(bufnr('%'))).to_equal([
\ 'javascript',
\ 'jsx',
\ 'global'
\ ])
End
End
Describe #find
It should load snippet for extended filetypes
enew!
set filetype=source_spec_enhanced
let l:snippets = vsnip#source#find(bufnr('%'))
call s:expect(l:snippets[0]).to_have_length(2)
End
It should load snippet from vscode extension
enew!
set filetype=source_spec_vscode
let l:snippets = vsnip#source#find(bufnr('%'))
call s:expect(l:snippets[0]).to_have_length(1)
End
It should format snippets
enew!
set filetype=source_spec
let l:snippets = vsnip#source#find(bufnr('%'))
call s:expect(sort(l:snippets[0])).to_equal(sort([{
\ 'label': 'no-prefix-alias',
\ 'description': '',
\ 'prefix': ['---'],
\ 'prefix_alias': [],
\ 'body': [
\ "${VIM:repeat('-', &tw)}"
\ ]
\ }, {
\ 'label': 'prefix-alias',
\ 'description': '',
\ 'prefix': ['arrow-function'],
\ 'prefix_alias': ['af'],
\ 'body': [
\ "() => "
\ ]
\ }]))
End
End
Describe #snipmate
It should load snippets
enew!
set filetype=snipmate
let l:snippets = vsnip#source#find(bufnr('%'))
call s:expect(l:snippets[0]).to_have_length(2)
End
It should format snippets
enew!
set filetype=snipmate
let l:snippets = vsnip#source#find(bufnr('%'))
call s:expect(sort(l:snippets[0])).to_equal(sort([{
\ 'label': 'arrow-function',
\ 'description': '',
\ 'prefix': ['arrow-function'],
\ 'prefix_alias': ['af'],
\ 'body': [
\ "() => "
\ ]
\ }, {
\ 'label': 'fn',
\ 'description': "vim's function",
\ 'prefix': ['fn'],
\ 'prefix_alias': [],
\ 'body': [
\ "function! $1($2) abort",
\ "\t$0",
\ "endfunction",
\ ]
\ }]))
End
End
End