Test failing commands

This commit is contained in:
baabelfish 2016-03-15 00:15:38 +02:00
commit 68d7b51d9d
7 changed files with 63 additions and 25 deletions

View file

@ -290,6 +290,7 @@ function! util#goto_file()
endfunction endfunction
try
call operator#user#define('nimrepl_send', 'NimReplSend') call operator#user#define('nimrepl_send', 'NimReplSend')
function! NimReplSend(motion_wiseness) function! NimReplSend(motion_wiseness)
let start = getpos("'[") let start = getpos("'[")
@ -300,6 +301,8 @@ function! NimReplSend(motion_wiseness)
echom str echom str
call features#repl#send(str) call features#repl#send(str)
endfunction endfunction
catch
endtry
let &cpo = s:save_cpo let &cpo = s:save_cpo

View file

@ -62,7 +62,7 @@ augroup END
augroup nvim_nim_outline augroup nvim_nim_outline
autocmd! FileWritePost *.nim call features#outline#run(1) autocmd! FileWritePost *.nim call features#outline#run(1)
autocmd! VimResized,WinEnter * call features#outline#render() autocmd! VimResized,WinEnter *.nim call features#outline#render()
augroup END augroup END
if g:nvim_nim_highlighter_enable if g:nvim_nim_highlighter_enable

View file

@ -1,5 +1,5 @@
filetype off filetype off
set rtp+=./plugins/vader.vim set rtp+=./plugins/vader.vim
set rtp+=./plugins/nvim-nim set rtp+=..
filetype plugin indent on filetype plugin indent on
syntax enable syntax enable

View file

@ -1,14 +1,19 @@
#!/bin/bash #!/bin/bash
# Intall plugins # Intall plugins
if [[ ! -d plugins ]]; then
mkdir plugins mkdir plugins
git clone https://github.com/baabelfish/vader.vim plugins/vader.vim git clone https://github.com/baabelfish/vader.vim plugins/vader.vim
git clone https://github.com/baabelfish/nvim-nim plugins/nvim-nim # git clone https://github.com/baabelfish/nvim-nim plugins/nvim-nim
fi
# Run tests # Run tests
nvim -u rc.vim -c 'Vader! tests/**/*.vader' nvim -c 'Vader! tests/**/*.vader' > /dev/null
err=$? err=$?
if [ "$err" != "0" ]; then if [ "$err" != "0" ]; then
cat report.log cat report.log
exit 1 exit 1
else
echo ""
echo "Great success!"
fi fi

View file

@ -1,9 +1,36 @@
Do (file): Given nim:
ifoo\<esc> echo "hello"
Expect (else): Do:
foo gg
Then:
AssertEqual "nim", &filetype
Assert exists(":NimDebug") > 0
Assert exists(":NimDefinition") > 0
Assert exists(":NimInfo") > 0
Assert exists(":NimWeb") > 0
Assert exists(":NimUsages") > 0
Assert exists(":NimUsagesProject") > 0
Assert exists(":NimRenameSymbol") > 0
Assert exists(":NimRenameSymbolProject") > 0
Assert exists(":NimDebug") > 0
Assert exists(":NimOutline") > 0
Assert exists(":NimOutlineUpdate") > 0
Execute (something): Execute:
AssertEqual 1, 2 NimInfo
NimDebug
NimDefinition
NimUsages
NimUsagesProject
NimOutline
Given cpp:
std::cout << "hello world" << std::endl;
Do:
gg
Then:
AssertEqual "cpp", &filetype

6
other/testwatcher.sh Executable file
View file

@ -0,0 +1,6 @@
#!/bin/bash
while inotifywait -r -q -e close_write "../autoload" "."
do
./run_tests.sh
sleep 1
done

View file

@ -81,9 +81,6 @@ git clone https://github.com/baabelfish/nvim-nim
tree ~/.config/nvim tree ~/.config/nvim
# echo "Run nim tests"
# nim c tests/nimsuggest/suggestions.nim
echo "================================================================================" echo "================================================================================"
echo "Run vim tests" echo "Run vim tests"
cd $current/other cd $current/other