aboutsummaryrefslogtreecommitdiff
path: root/vim/bundle/vim-table-mode/t/align.vim
blob: 930504d5b1324b1a516dd9b20c8cf7a1354955e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
" vim: fdm=indent
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

describe 'Align'
  it 'should align table content correctly'
    Expect tablemode#align#Align(ConvertLines2Dict(readfile('t/fixtures/align/simple_before.txt'))) == ConvertLines2Dict(readfile('t/fixtures/align/simple_after.txt'))
  end

  it 'should align table content with unicode characters correctly'
    Expect tablemode#align#Align(ConvertLines2Dict(readfile('t/fixtures/align/unicode_before.txt'))) == ConvertLines2Dict(readfile('t/fixtures/align/unicode_after.txt'))
  end
end