summaryrefslogtreecommitdiffstats
path: root/autoload/vimtex/test.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2020-05-20 20:19:03 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2020-05-20 20:19:03 +0200
commita9cc6fd2188ddc37257c834b6f5a5fa86d0eebd5 (patch)
tree952fc9cf50a5f4c42ffb2b1c0077155bcda3e7c1 /autoload/vimtex/test.vim
parent3c47f192b5758222a1e8055c7e08650e05d0d171 (diff)
downloadvim-polyglot-a9cc6fd2188ddc37257c834b6f5a5fa86d0eebd5.tar.gz
vim-polyglot-a9cc6fd2188ddc37257c834b6f5a5fa86d0eebd5.zip
Remove latex, fixes #484
Diffstat (limited to 'autoload/vimtex/test.vim')
-rw-r--r--autoload/vimtex/test.vim98
1 files changed, 0 insertions, 98 deletions
diff --git a/autoload/vimtex/test.vim b/autoload/vimtex/test.vim
deleted file mode 100644
index 9b9d50a2..00000000
--- a/autoload/vimtex/test.vim
+++ /dev/null
@@ -1,98 +0,0 @@
-if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'latex') == -1
-
-" vimtex - LaTeX plugin for Vim
-"
-" Maintainer: Karl Yngve LervÄg
-" Email: karl.yngve@gmail.com
-"
-
-function! vimtex#test#assert(condition) abort " {{{1
- if a:condition | return 1 | endif
-
- call s:fail()
-endfunction
-
-" }}}1
-function! vimtex#test#assert_equal(expect, observe) abort " {{{1
- if a:expect ==# a:observe | return 1 | endif
-
- call s:fail([
- \ 'expect: ' . string(a:expect),
- \ 'observe: ' . string(a:observe),
- \])
-endfunction
-
-" }}}1
-function! vimtex#test#assert_match(x, regex) abort " {{{1
- if a:x =~# a:regex | return 1 | endif
-
- call s:fail([
- \ 'x = ' . string(a:x),
- \ 'regex = ' . a:regex,
- \])
-endfunction
-
-" }}}1
-
-function! vimtex#test#completion(context, ...) abort " {{{1
- let l:base = a:0 > 0 ? a:1 : ''
-
- try
- silent execute 'normal GO' . a:context . "\<c-x>\<c-o>"
- silent normal! u
- return vimtex#complete#omnifunc(0, l:base)
- catch /.*/
- call s:fail(v:exception)
- endtry
-endfunction
-
-" }}}1
-function! vimtex#test#keys(keys, context, expected) abort " {{{1
- normal! gg0dG
- call append(1, a:context)
- normal! ggdd
-
- let l:fail_msg = ['keys: ' . a:keys]
- let l:fail_msg += ['context:']
- let l:fail_msg += map(copy(a:context), '" " . v:val')
- let l:fail_msg += ['expected:']
- let l:fail_msg += map(copy(a:expected), '" " . v:val')
-
- try
- silent execute 'normal' a:keys
- catch
- let l:fail_msg += ['error:']
- let l:fail_msg += [' ' . v:exception]
- call s:fail(l:fail_msg)
- endtry
-
- let l:result = getline(1, line('$'))
- if l:result ==# a:expected | return 1 | endif
-
- let l:fail_msg += ['result:']
- let l:fail_msg += map(l:result, '" " . v:val')
- call s:fail(l:fail_msg)
-endfunction
-
-" }}}1
-
-function! s:fail(...) abort " {{{1
- echo 'Assertion failed!'
-
- if a:0 > 0 && !empty(a:1)
- if type(a:1) == type('')
- echo a:1
- else
- for line in a:1
- echo line
- endfor
- endif
- endif
- echon "\n"
-
- cquit
-endfunction
-
-" }}}1
-
-endif