Fix tests for neovim

This commit is contained in:
Dhruva Sagar
2023-08-31 21:43:51 +05:30
parent 0dd8aff6d1
commit ed55bc2828
4 changed files with 16 additions and 10 deletions

View File

@@ -47,3 +47,4 @@ jobs:
cd ${{ github.workspace }}/pack/plugins/start/vim-table-mode
echo "set packpath+=${{ github.workspace }}" > vimrc
${VIM} -u vimrc +TestifySuite +qall
cat testify_results.txt

View File

@@ -7,7 +7,12 @@ function! s:setup()
call utils#TestSetup(s:test_file)
endfunction
call testify#setup(function('s:setup'))
call testify#teardown(function('utils#TestTeardown'))
function! s:teardown()
let g:table_mode_header_fillchar = '-'
bw!
endfunction
call testify#teardown(function('s:teardown'))
function! s:TestDeleteRow()
call cursor(5, 7)

View File

@@ -15,7 +15,7 @@ function! s:TestAddFormula()
call testify#assert#equals(cell_value, '125.0')
call cursor(9, 15)
call testify#assert#equals(getline('.'), '/* tmf: $4,2=Sum(1:3) */')
call testify#assert#equals(getline('.'), ' tmf: $4,2=Sum(1:3) ')
call cursor(8, 15)
call tablemode#spreadsheet#formula#Add('Sum(1:-1)')
@@ -23,6 +23,6 @@ function! s:TestAddFormula()
call testify#assert#equals(cell_value, '250.0')
call cursor(9, 15)
call testify#assert#equals(getline('.'), '/* tmf: $4,2=Sum(1:3); $5,2=Sum(1:-1) */')
call testify#assert#equals(getline('.'), ' tmf: $4,2=Sum(1:3) ; $5,2=Sum(1:-1)')
endfunction
call testify#it('Should Add a formula to the table correctly', function('s:TestAddFormula'))

View File

@@ -1,7 +1,7 @@
| Item | Cost |
|----------+-------|
| Bread | 20 |
| Tomatoes | 5 |
| Pasta | 100 |
| Total | 0 |
/* tmf: $4,2=Sum(1:-1) */
| Item | Cost |
|----------+------|
| Bread | 20 |
| Tomatoes | 5 |
| Pasta | 100 |
| Total | 0 |
tmf: $4,2=Sum(1:-1)