mirror of
1
0
Fork 0
ultimate-vim/sources_non_forked/vim-snippets/tests.sh

38 lines
777 B
Bash
Raw Normal View History

2015-07-13 06:22:46 -04:00
#!/usr/bin/env bash
2019-03-08 06:04:56 -05:00
check=0
function test_space_indented {
local spaced
spaced=$(grep -REn '^ ' --include '*.snippets' snippets)
if [[ $? -ne 1 ]]; then
echo "These snippet lines are indented with spaces:"
echo "$spaced"
echo
(( check++ ))
fi
}
function test_snipmate_format {
local ultisnips_in_snipmate
ultisnips_in_snipmate=$(grep -REn 'endsnippet' --include '*.snippets' snippets)
if [[ $? -ne 1 ]]; then
echo "These snippet definitions are probably in UltiSnips format but stored in the snipmate directory"
echo "$ultisnips_in_snipmate"
echo
(( check++ ))
fi
}
test_space_indented
test_snipmate_format
if [ $check -eq 0 ]; then
echo "Tests passed!"
exit 0
else
echo "$check test(s) failed out of 2!"
2015-12-08 08:20:04 -05:00
exit 1
2015-07-13 06:22:46 -04:00
fi