mirror of
https://github.com/dhruvasagar/vim-table-mode.git
synced 2025-11-11 12:33:47 -05:00
Rewrite tests with vim-testify
This commit is contained in:
23
t/autoload/tablemode/align_test.vim
Normal file
23
t/autoload/tablemode/align_test.vim
Normal file
@@ -0,0 +1,23 @@
|
||||
source t/config/options.vim
|
||||
|
||||
function! ConvertLines2Dict(lines)
|
||||
let lines = []
|
||||
for idx in range(len(a:lines))
|
||||
call insert(lines, {"lnum": idx+1, "text": a:lines[idx]})
|
||||
endfor
|
||||
return lines
|
||||
endfunction
|
||||
|
||||
function! s:TestAlignTable()
|
||||
let actual = tablemode#align#Align(ConvertLines2Dict(readfile('t/fixtures/align/simple_before.txt')))
|
||||
let expected = ConvertLines2Dict(readfile('t/fixtures/align/simple_after.txt'))
|
||||
call testify#assert#equals(actual, expected)
|
||||
endfunction
|
||||
call testify#it('Align should align table content', function('s:TestAlignTable'))
|
||||
|
||||
function! s:TestAlignTableUnicode()
|
||||
let actual = tablemode#align#Align(ConvertLines2Dict(readfile('t/fixtures/align/unicode_before.txt')))
|
||||
let expected = ConvertLines2Dict(readfile('t/fixtures/align/unicode_after.txt'))
|
||||
call testify#assert#equals(actual, expected)
|
||||
endfunction
|
||||
call testify#it('Align should align table content with unicode characters', function('s:TestAlignTableUnicode'))
|
||||
Reference in New Issue
Block a user