mirror of
https://github.com/dhruvasagar/vim-table-mode.git
synced 2025-11-08 11:03:47 -05:00
Added fixtures
This commit is contained in:
@@ -5,14 +5,10 @@ call vspec#hint({'scope': 'tablemode#align#scope()', 'sid': 'tablemode#align#sid
|
||||
|
||||
describe 'Align'
|
||||
it 'should align table content correctly'
|
||||
let lines = ['| This | is a | table |', '| This | is also | a table |']
|
||||
let result = ['| This | is a | table |', '| This | is also | a table |']
|
||||
Expect tablemode#align#Align(lines) == result
|
||||
Expect tablemode#align#Align(readfile('t/fixtures/align/simple_before.txt')) == readfile('t/fixtures/align/simple_after.txt')
|
||||
end
|
||||
|
||||
it 'should align table content with unicode characters correctly'
|
||||
let lines = ['| This | is 測試 | table |', '| This | is also | a table |']
|
||||
let result = ['| This | is 測試 | table |', '| This | is also | a table |']
|
||||
Expect tablemode#align#Align(lines) == result
|
||||
Expect tablemode#align#Align(readfile('t/fixtures/align/unicode_before.txt')) == readfile('t/fixtures/align/unicode_after.txt')
|
||||
end
|
||||
end
|
||||
|
||||
2
t/fixtures/align/simple_after.txt
Normal file
2
t/fixtures/align/simple_after.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
| This | is a | table |
|
||||
| This | is also | a table |
|
||||
2
t/fixtures/align/simple_before.txt
Normal file
2
t/fixtures/align/simple_before.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
|This|is a|table|
|
||||
|This|is also|a table|
|
||||
2
t/fixtures/align/unicode_after.txt
Normal file
2
t/fixtures/align/unicode_after.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
| This | is 測試 | table |
|
||||
| This | is also | a table |
|
||||
2
t/fixtures/align/unicode_before.txt
Normal file
2
t/fixtures/align/unicode_before.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
| This | is 測試 | table |
|
||||
| This | is also | a table |
|
||||
4
t/fixtures/sample.txt
Normal file
4
t/fixtures/sample.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
| test11 | test12 |
|
||||
| test21 | test22 |
|
||||
|
||||
4
t/fixtures/tableize.txt
Normal file
4
t/fixtures/tableize.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
asd,asd;asd,asd
|
||||
asd,asd;asd,asd
|
||||
|
||||
@@ -7,9 +7,7 @@ describe 'spreadsheet'
|
||||
describe 'API'
|
||||
before
|
||||
new
|
||||
normal! ggdG
|
||||
call tablemode#TableModeEnable()
|
||||
normal i
|
||||
read t/fixtures/sample.txt
|
||||
end
|
||||
|
||||
it 'should return the row count'
|
||||
@@ -79,7 +77,6 @@ describe 'spreadsheet'
|
||||
describe 'Manipulations'
|
||||
before
|
||||
new
|
||||
before
|
||||
normal i|test11|test12|
|
||||
|test21|test22|
|
||||
call cursor(1, 3)
|
||||
|
||||
@@ -7,9 +7,7 @@ describe 'table'
|
||||
describe 'API'
|
||||
before
|
||||
new
|
||||
normal! ggdG
|
||||
call tablemode#TableModeEnable()
|
||||
normal i
|
||||
read t/fixtures/sample.txt
|
||||
end
|
||||
|
||||
it 'should return true when inside a table'
|
||||
@@ -24,8 +22,7 @@ describe 'table'
|
||||
describe 'Tableize'
|
||||
before
|
||||
new
|
||||
before
|
||||
new
|
||||
read t/fixtures/tableize.txt
|
||||
end
|
||||
|
||||
it 'should tableize with default delimiter'
|
||||
|
||||
Reference in New Issue
Block a user