Test failing commands
This commit is contained in:
parent
e58a94802a
commit
68d7b51d9d
7 changed files with 63 additions and 25 deletions
|
|
@ -290,16 +290,19 @@ function! util#goto_file()
|
|||
endfunction
|
||||
|
||||
|
||||
call operator#user#define('nimrepl_send', 'NimReplSend')
|
||||
function! NimReplSend(motion_wiseness)
|
||||
let start = getpos("'[")
|
||||
let stop = getpos("']")
|
||||
let start_line = start[1]
|
||||
let stop_line = stop[1]
|
||||
let str = join(getline(start_line, stop_line), "\n")
|
||||
echom str
|
||||
call features#repl#send(str)
|
||||
endfunction
|
||||
try
|
||||
call operator#user#define('nimrepl_send', 'NimReplSend')
|
||||
function! NimReplSend(motion_wiseness)
|
||||
let start = getpos("'[")
|
||||
let stop = getpos("']")
|
||||
let start_line = start[1]
|
||||
let stop_line = stop[1]
|
||||
let str = join(getline(start_line, stop_line), "\n")
|
||||
echom str
|
||||
call features#repl#send(str)
|
||||
endfunction
|
||||
catch
|
||||
endtry
|
||||
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ augroup END
|
|||
|
||||
augroup nvim_nim_outline
|
||||
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
|
||||
|
||||
if g:nvim_nim_highlighter_enable
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
filetype off
|
||||
set rtp+=./plugins/vader.vim
|
||||
set rtp+=./plugins/nvim-nim
|
||||
set rtp+=..
|
||||
filetype plugin indent on
|
||||
syntax enable
|
||||
|
|
|
|||
|
|
@ -1,14 +1,19 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Intall plugins
|
||||
mkdir plugins
|
||||
git clone https://github.com/baabelfish/vader.vim plugins/vader.vim
|
||||
git clone https://github.com/baabelfish/nvim-nim plugins/nvim-nim
|
||||
if [[ ! -d plugins ]]; then
|
||||
mkdir plugins
|
||||
git clone https://github.com/baabelfish/vader.vim plugins/vader.vim
|
||||
# git clone https://github.com/baabelfish/nvim-nim plugins/nvim-nim
|
||||
fi
|
||||
|
||||
# Run tests
|
||||
nvim -u rc.vim -c 'Vader! tests/**/*.vader'
|
||||
nvim -c 'Vader! tests/**/*.vader' > /dev/null
|
||||
err=$?
|
||||
if [ "$err" != "0" ]; then
|
||||
cat report.log
|
||||
exit 1
|
||||
else
|
||||
echo ""
|
||||
echo "Great success!"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -1,9 +1,36 @@
|
|||
Do (file):
|
||||
ifoo\<esc>
|
||||
Given nim:
|
||||
echo "hello"
|
||||
|
||||
Expect (else):
|
||||
foo
|
||||
Do:
|
||||
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):
|
||||
AssertEqual 1, 2
|
||||
Execute:
|
||||
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
6
other/testwatcher.sh
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
#!/bin/bash
|
||||
while inotifywait -r -q -e close_write "../autoload" "."
|
||||
do
|
||||
./run_tests.sh
|
||||
sleep 1
|
||||
done
|
||||
|
|
@ -81,9 +81,6 @@ git clone https://github.com/baabelfish/nvim-nim
|
|||
tree ~/.config/nvim
|
||||
|
||||
|
||||
# echo "Run nim tests"
|
||||
# nim c tests/nimsuggest/suggestions.nim
|
||||
|
||||
echo "================================================================================"
|
||||
echo "Run vim tests"
|
||||
cd $current/other
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue