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'
|
describe 'Align'
|
||||||
it 'should align table content correctly'
|
it 'should align table content correctly'
|
||||||
let lines = ['| This | is a | table |', '| This | is also | a table |']
|
Expect tablemode#align#Align(readfile('t/fixtures/align/simple_before.txt')) == readfile('t/fixtures/align/simple_after.txt')
|
||||||
let result = ['| This | is a | table |', '| This | is also | a table |']
|
|
||||||
Expect tablemode#align#Align(lines) == result
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should align table content with unicode characters correctly'
|
it 'should align table content with unicode characters correctly'
|
||||||
let lines = ['| This | is 測試 | table |', '| This | is also | a table |']
|
Expect tablemode#align#Align(readfile('t/fixtures/align/unicode_before.txt')) == readfile('t/fixtures/align/unicode_after.txt')
|
||||||
let result = ['| This | is 測試 | table |', '| This | is also | a table |']
|
|
||||||
Expect tablemode#align#Align(lines) == result
|
|
||||||
end
|
end
|
||||||
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'
|
describe 'API'
|
||||||
before
|
before
|
||||||
new
|
new
|
||||||
normal! ggdG
|
read t/fixtures/sample.txt
|
||||||
call tablemode#TableModeEnable()
|
|
||||||
normal i
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should return the row count'
|
it 'should return the row count'
|
||||||
@@ -79,7 +77,6 @@ describe 'spreadsheet'
|
|||||||
describe 'Manipulations'
|
describe 'Manipulations'
|
||||||
before
|
before
|
||||||
new
|
new
|
||||||
before
|
|
||||||
normal i|test11|test12|
|
normal i|test11|test12|
|
||||||
|test21|test22|
|
|test21|test22|
|
||||||
call cursor(1, 3)
|
call cursor(1, 3)
|
||||||
|
|||||||
@@ -7,9 +7,7 @@ describe 'table'
|
|||||||
describe 'API'
|
describe 'API'
|
||||||
before
|
before
|
||||||
new
|
new
|
||||||
normal! ggdG
|
read t/fixtures/sample.txt
|
||||||
call tablemode#TableModeEnable()
|
|
||||||
normal i
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should return true when inside a table'
|
it 'should return true when inside a table'
|
||||||
@@ -24,8 +22,7 @@ describe 'table'
|
|||||||
describe 'Tableize'
|
describe 'Tableize'
|
||||||
before
|
before
|
||||||
new
|
new
|
||||||
before
|
read t/fixtures/tableize.txt
|
||||||
new
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should tableize with default delimiter'
|
it 'should tableize with default delimiter'
|
||||||
|
|||||||
Reference in New Issue
Block a user