aboutsummaryrefslogtreecommitdiff
path: root/vim/bundle/vim-table-mode/t
diff options
context:
space:
mode:
Diffstat (limited to 'vim/bundle/vim-table-mode/t')
m---------vim/bundle/vim-table-mode0
-rw-r--r--vim/bundle/vim-table-mode/t/align.vim20
-rw-r--r--vim/bundle/vim-table-mode/t/cell.vim135
-rw-r--r--vim/bundle/vim-table-mode/t/config/options.vim27
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/align/simple_after.txt2
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/align/simple_before.txt2
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/align/unicode_after.txt2
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/align/unicode_before.txt2
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/cell/sample.txt2
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/formula/formula.txt7
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/formula/sample.txt7
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/sample.txt4
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/table/sample.txt4
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/table/sample_for_header.txt3
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/table/sample_for_header_unicode.txt9
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_after.txt4
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_before.txt4
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_unicode_after.txt8
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_unicode_before.txt8
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_after.txt2
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_before.txt2
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_unicode_after.txt4
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_unicode_before.txt4
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/table/sample_with_header.txt7
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/tableize.txt4
-rw-r--r--vim/bundle/vim-table-mode/t/formula.vim39
-rw-r--r--vim/bundle/vim-table-mode/t/spreadsheet.vim105
-rw-r--r--vim/bundle/vim-table-mode/t/table.vim184
-rw-r--r--vim/bundle/vim-table-mode/t/tablemode.vim56
-rw-r--r--vim/bundle/vim-table-mode/t/utils.vim45
30 files changed, 0 insertions, 702 deletions
diff --git a/vim/bundle/vim-table-mode b/vim/bundle/vim-table-mode
new file mode 160000
+Subproject b613e39bd08ecebdb9b18100dae518050f49604
diff --git a/vim/bundle/vim-table-mode/t/align.vim b/vim/bundle/vim-table-mode/t/align.vim
deleted file mode 100644
index 930504d..0000000
--- a/vim/bundle/vim-table-mode/t/align.vim
+++ /dev/null
@@ -1,20 +0,0 @@
-" 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
diff --git a/vim/bundle/vim-table-mode/t/cell.vim b/vim/bundle/vim-table-mode/t/cell.vim
deleted file mode 100644
index e3d03ed..0000000
--- a/vim/bundle/vim-table-mode/t/cell.vim
+++ /dev/null
@@ -1,135 +0,0 @@
-" vim: fdm=indent
-source t/config/options.vim
-
-describe 'cell'
- describe 'API'
- before
- new
- read t/fixtures/sample.txt
- end
-
- it 'should return the cells with GetCells'
- Expect tablemode#spreadsheet#cell#GetCells(2, 1, 1) ==# 'test11'
- " Get Rows
- Expect tablemode#spreadsheet#cell#GetCells(2, 1) == ['test11', 'test12']
- Expect tablemode#spreadsheet#cell#GetCells(2, 2) == ['test21', 'test22']
- " Get Columns
- Expect tablemode#spreadsheet#cell#GetCells(2, 0, 1) == ['test11', 'test21']
- Expect tablemode#spreadsheet#cell#GetCells(2, 0, 2) == ['test12', 'test22']
- end
-
- it 'should return the row with GetRow'
- Expect tablemode#spreadsheet#cell#GetRow(1, 2) == ['test11', 'test12']
- Expect tablemode#spreadsheet#cell#GetRow(2, 2) == ['test21', 'test22']
- end
-
- it 'should return the column with GetColumn'
- Expect tablemode#spreadsheet#cell#GetColumn(1, 2) == ['test11', 'test21']
- Expect tablemode#spreadsheet#cell#GetColumn(2, 2) == ['test12', 'test22']
- end
-
- it 'should return the cells in a range with GetCellRange'
- " Entire table as range
- Expect tablemode#spreadsheet#cell#GetCellRange('1,1:2,2', 2, 1) == [['test11', 'test21'], ['test12', 'test22']]
-
- " Get Rows given different seed lines and columns
- Expect tablemode#spreadsheet#cell#GetCellRange('1,1:1,2', 2, 1) == ['test11', 'test12']
- Expect tablemode#spreadsheet#cell#GetCellRange('1,1:1,2', 2, 2) == ['test11', 'test12']
- Expect tablemode#spreadsheet#cell#GetCellRange('1,1:1,2', 3, 1) == ['test11', 'test12']
- Expect tablemode#spreadsheet#cell#GetCellRange('1,1:1,2', 3, 2) == ['test11', 'test12']
- Expect tablemode#spreadsheet#cell#GetCellRange('2,1:2,2', 2, 1) == ['test21', 'test22']
- Expect tablemode#spreadsheet#cell#GetCellRange('2,1:2,2', 2, 2) == ['test21', 'test22']
- Expect tablemode#spreadsheet#cell#GetCellRange('2,1:2,2', 3, 1) == ['test21', 'test22']
- Expect tablemode#spreadsheet#cell#GetCellRange('2,1:2,2', 3, 2) == ['test21', 'test22']
-
- " Get Columns given different seed lines and column
- Expect tablemode#spreadsheet#cell#GetCellRange('1:2', 2, 1) == ['test11', 'test21']
- Expect tablemode#spreadsheet#cell#GetCellRange('1:2', 2, 2) == ['test12', 'test22']
- Expect tablemode#spreadsheet#cell#GetCellRange('1:2', 3, 1) == ['test11', 'test21']
- Expect tablemode#spreadsheet#cell#GetCellRange('1:2', 3, 2) == ['test12', 'test22']
-
- " Get Column given negative values in range for representing rows from
- " the end, -1 being the second last row.
- Expect tablemode#spreadsheet#cell#GetCellRange('1:-1', 2, 1) == ['test11']
- Expect tablemode#spreadsheet#cell#GetCellRange('1:-1', 3, 1) == ['test11']
- Expect tablemode#spreadsheet#cell#GetCellRange('1:-1', 2, 2) == ['test12']
- Expect tablemode#spreadsheet#cell#GetCellRange('1:-1', 3, 2) == ['test12']
- end
- end
-
- describe 'Motions'
- describe 'left or right'
- before
- new
- normal! ggdG
- read t/fixtures/sample.txt
- call cursor(2, 3)
- end
-
- it 'should move left when not on first column'
- call cursor(2, 12)
- Expect tablemode#spreadsheet#ColumnNr('.') == 2
- call tablemode#spreadsheet#cell#Motion('h')
- Expect tablemode#spreadsheet#ColumnNr('.') == 1
- end
-
- it 'should move to the previous row last column if it exists when on first column'
- call cursor(3, 3)
- Expect tablemode#spreadsheet#RowNr('.') == 2
- Expect tablemode#spreadsheet#ColumnNr('.') == 1
- call tablemode#spreadsheet#cell#Motion('h')
- Expect tablemode#spreadsheet#RowNr('.') == 1
- Expect tablemode#spreadsheet#ColumnNr('.') == 2
- end
-
- it 'should move right when not on last column'
- Expect tablemode#spreadsheet#ColumnNr('.') == 1
- call tablemode#spreadsheet#cell#Motion('l')
- Expect tablemode#spreadsheet#ColumnNr('.') == 2
- end
-
- it 'should move to the next row first column if it exists when on last column'
- call cursor(2, 12)
- Expect tablemode#spreadsheet#RowNr('.') == 1
- Expect tablemode#spreadsheet#ColumnNr('.') == 2
- call tablemode#spreadsheet#cell#Motion('l')
- Expect tablemode#spreadsheet#RowNr('.') == 2
- Expect tablemode#spreadsheet#ColumnNr('.') == 1
- end
- end
-
- describe 'up or down'
- before
- new
- normal! ggdG
- read t/fixtures/sample.txt
- call cursor(2, 3)
- end
-
- it 'should move a row up unless on first row'
- call cursor(3, 3)
- Expect tablemode#spreadsheet#RowNr('.') == 2
- call tablemode#spreadsheet#cell#Motion('k')
- Expect tablemode#spreadsheet#RowNr('.') == 1
- end
-
- it 'should remain on first row when trying to move up'
- Expect tablemode#spreadsheet#RowNr('.') == 1
- call tablemode#spreadsheet#cell#Motion('k')
- Expect tablemode#spreadsheet#RowNr('.') == 1
- end
-
- it 'should move a row down unless on last row'
- Expect tablemode#spreadsheet#RowNr('.') == 1
- call tablemode#spreadsheet#cell#Motion('j')
- Expect tablemode#spreadsheet#RowNr('.') == 2
- end
-
- it 'should remain on last row when trying to move down'
- Expect tablemode#spreadsheet#RowNr('.') == 1
- call tablemode#spreadsheet#cell#Motion('k')
- Expect tablemode#spreadsheet#RowNr('.') == 1
- end
- end
- end
-end
diff --git a/vim/bundle/vim-table-mode/t/config/options.vim b/vim/bundle/vim-table-mode/t/config/options.vim
deleted file mode 100644
index 99b5098..0000000
--- a/vim/bundle/vim-table-mode/t/config/options.vim
+++ /dev/null
@@ -1,27 +0,0 @@
-let g:table_mode_corner = '+'
-let g:table_mode_separator = '|'
-let g:table_mode_fillchar = '-'
-let g:table_mode_header_fillchar = '-'
-let g:table_mode_map_prefix = '<Leader>t'
-let g:table_mode_toggle_map = 'm'
-let g:table_mode_always_active = 0
-let g:table_mode_delimiter = ','
-let g:table_mode_corner_corner = '|'
-let g:table_mode_align_char = ':'
-let g:table_mode_disable_mappings = 0
-
-let g:table_mode_motion_up_map = '{<Bar>'
-let g:table_mode_motion_down_map = '}<Bar>'
-let g:table_mode_motion_left_map = '[<Bar>'
-let g:table_mode_motion_right_map = ']<Bar>'
-
-let g:table_mode_cell_text_object_a_map = 'a<Bar>'
-let g:table_mode_cell_text_object_i_map = 'i<Bar>'
-
-let g:table_mode_realign_map = '<Leader>tr'
-let g:table_mode_delete_row_map = '<Leader>tdd'
-let g:table_mode_delete_column_map = '<Leader>tdc'
-let g:table_mode_add_formula_map = '<Leader>tfa'
-let g:table_mode_eval_formula_map = '<Leader>tfe'
-let g:table_mode_echo_cell_map = '<Leader>t?'
-let g:table_mode_sort_map = '<Leader>ts'
diff --git a/vim/bundle/vim-table-mode/t/fixtures/align/simple_after.txt b/vim/bundle/vim-table-mode/t/fixtures/align/simple_after.txt
deleted file mode 100644
index ed96f07..0000000
--- a/vim/bundle/vim-table-mode/t/fixtures/align/simple_after.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-| This | is a | table |
-| This | is also | a table |
diff --git a/vim/bundle/vim-table-mode/t/fixtures/align/simple_before.txt b/vim/bundle/vim-table-mode/t/fixtures/align/simple_before.txt
deleted file mode 100644
index b483ea5..0000000
--- a/vim/bundle/vim-table-mode/t/fixtures/align/simple_before.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-|This|is a|table|
-|This|is also|a table|
diff --git a/vim/bundle/vim-table-mode/t/fixtures/align/unicode_after.txt b/vim/bundle/vim-table-mode/t/fixtures/align/unicode_after.txt
deleted file mode 100644
index 8778914..0000000
--- a/vim/bundle/vim-table-mode/t/fixtures/align/unicode_after.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-| This | is 測試 | table |
-| This | is also | a table |
diff --git a/vim/bundle/vim-table-mode/t/fixtures/align/unicode_before.txt b/vim/bundle/vim-table-mode/t/fixtures/align/unicode_before.txt
deleted file mode 100644
index 3edd654..0000000
--- a/vim/bundle/vim-table-mode/t/fixtures/align/unicode_before.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-| This | is 測試 | table |
-| This | is also | a table |
diff --git a/vim/bundle/vim-table-mode/t/fixtures/cell/sample.txt b/vim/bundle/vim-table-mode/t/fixtures/cell/sample.txt
deleted file mode 100644
index 9e670d5..0000000
--- a/vim/bundle/vim-table-mode/t/fixtures/cell/sample.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-| 1 | 2 |
-| 3 | 4 |
diff --git a/vim/bundle/vim-table-mode/t/fixtures/formula/formula.txt b/vim/bundle/vim-table-mode/t/fixtures/formula/formula.txt
deleted file mode 100644
index ab2df91..0000000
--- a/vim/bundle/vim-table-mode/t/fixtures/formula/formula.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-| Item | Cost |
-|----------+-------|
-| Bread | 20 |
-| Tomatoes | 5 |
-| Pasta | 100 |
-| Total | 0 |
-/* tmf: $4,2=Sum(1:-1) */
diff --git a/vim/bundle/vim-table-mode/t/fixtures/formula/sample.txt b/vim/bundle/vim-table-mode/t/fixtures/formula/sample.txt
deleted file mode 100644
index 2920bbc..0000000
--- a/vim/bundle/vim-table-mode/t/fixtures/formula/sample.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-| Item | Cost |
-|----------+------|
-| Bread | 20 |
-| Tomatoes | 5 |
-| Pasta | 100 |
-| Total | |
-| Test | |
diff --git a/vim/bundle/vim-table-mode/t/fixtures/sample.txt b/vim/bundle/vim-table-mode/t/fixtures/sample.txt
deleted file mode 100644
index e447226..0000000
--- a/vim/bundle/vim-table-mode/t/fixtures/sample.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-
-| test11 | test12 |
-| test21 | test22 |
-
diff --git a/vim/bundle/vim-table-mode/t/fixtures/table/sample.txt b/vim/bundle/vim-table-mode/t/fixtures/table/sample.txt
deleted file mode 100644
index e447226..0000000
--- a/vim/bundle/vim-table-mode/t/fixtures/table/sample.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-
-| test11 | test12 |
-| test21 | test22 |
-
diff --git a/vim/bundle/vim-table-mode/t/fixtures/table/sample_for_header.txt b/vim/bundle/vim-table-mode/t/fixtures/table/sample_for_header.txt
deleted file mode 100644
index 75f8f25..0000000
--- a/vim/bundle/vim-table-mode/t/fixtures/table/sample_for_header.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-| test11 | test12 |
-
-| test21 | test22 |
diff --git a/vim/bundle/vim-table-mode/t/fixtures/table/sample_for_header_unicode.txt b/vim/bundle/vim-table-mode/t/fixtures/table/sample_for_header_unicode.txt
deleted file mode 100644
index 7b4e02a..0000000
--- a/vim/bundle/vim-table-mode/t/fixtures/table/sample_for_header_unicode.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-
-| abc | 测试长度 | 长测试 |
-
-| 长 | 测试测试测试测试 | 测试测试 |
-
-| 测试测试 | 测试 | 测试测测试 |
-
-| 测试测试测试 | 测试测试 | 测试 |
-
diff --git a/vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_after.txt b/vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_after.txt
deleted file mode 100644
index e4362a1..0000000
--- a/vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_after.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-| S. No | Title | Message |
-|-------+:------+:-------:|
-| 1 | t1 | msg1 |
-| 2 | t2 | msg2 |
diff --git a/vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_before.txt b/vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_before.txt
deleted file mode 100644
index 1f65bfd..0000000
--- a/vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_before.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-|S. No|Title|Message|
-|-----+:----+:-----:|
-|1|t1|msg1|
-|2|t2|msg2|
diff --git a/vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_unicode_after.txt b/vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_unicode_after.txt
deleted file mode 100644
index 4c70b01..0000000
--- a/vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_unicode_after.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-|--------------+------------------+------------|
-| 测试测试 | 测试长度 | 长测试 |
-|--------------+:----------------:+-----------:|
-| abc | 测试长度 | 长测试 |
-| 长 | 测试测试测试测试 | 测试测试 |
-| 测试测试 | 测试 | 测试测测试 |
-| 测试测试测试 | 测试测试 | 测试 |
-|--------------+------------------+------------|
diff --git a/vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_unicode_before.txt b/vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_unicode_before.txt
deleted file mode 100644
index 67bf1db..0000000
--- a/vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_unicode_before.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-|--------+--------+------|
-|测试测试|测试长度|长测试|
-|--------+:------:+-----:|
-|abc|测试长度|长测试|
-|长|测试测试测试测试|测试测试|
-|测试测试|测试|测试测测试|
-|测试测试测试|测试测试|测试|
-|------------+--------+----|
diff --git a/vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_after.txt b/vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_after.txt
deleted file mode 100644
index e7fd9e1..0000000
--- a/vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_after.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-| test11 | test12 |
-| test21 | test22 |
diff --git a/vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_before.txt b/vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_before.txt
deleted file mode 100644
index d1b3499..0000000
--- a/vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_before.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-|test11|test12|
-|test21|test22|
diff --git a/vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_unicode_after.txt b/vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_unicode_after.txt
deleted file mode 100644
index b479b24..0000000
--- a/vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_unicode_after.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-| abc | 测试长度 | 长测试 |
-| 长 | 测试测试测试测试 | 测试测试 |
-| 测试测试 | 测试 | 测试测测试 |
-| 测试测试测试 | 测试测试 | 测试 |
diff --git a/vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_unicode_before.txt b/vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_unicode_before.txt
deleted file mode 100644
index 8c3124f..0000000
--- a/vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_unicode_before.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-|abc|测试长度|长测试|
-|长|测试测试测试测试|测试测试|
-|测试测试|测试|测试测测试|
-|测试测试测试|测试测试|测试|
diff --git a/vim/bundle/vim-table-mode/t/fixtures/table/sample_with_header.txt b/vim/bundle/vim-table-mode/t/fixtures/table/sample_with_header.txt
deleted file mode 100644
index 9213e7f..0000000
--- a/vim/bundle/vim-table-mode/t/fixtures/table/sample_with_header.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-|--------+---------|
-| Title | Message |
-|--------+---------|
-| test11 | test12 |
-| test21 | test22 |
-|--------+---------|
-
diff --git a/vim/bundle/vim-table-mode/t/fixtures/tableize.txt b/vim/bundle/vim-table-mode/t/fixtures/tableize.txt
deleted file mode 100644
index ee1cc7a..0000000
--- a/vim/bundle/vim-table-mode/t/fixtures/tableize.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-
-asd,asd;asd,asd
-asd,asd;asd,asd
-
diff --git a/vim/bundle/vim-table-mode/t/formula.vim b/vim/bundle/vim-table-mode/t/formula.vim
deleted file mode 100644
index a052392..0000000
--- a/vim/bundle/vim-table-mode/t/formula.vim
+++ /dev/null
@@ -1,39 +0,0 @@
-" vim: fdm=indent
-source t/config/options.vim
-
-describe 'Formulas'
- describe 'Add Formula'
- before
- new
- read t/fixtures/formula/sample.txt
- end
-
- it 'should add a formula successfully'
- call cursor(6, 15)
- call tablemode#spreadsheet#formula#Add("Sum(1:3)")
- Expect tablemode#spreadsheet#cell#GetCell() == '125.0'
- call cursor(8, 15)
- Expect getline('.') == '/* tmf: $4,2=Sum(1:3) */'
-
- call cursor(7, 15)
- call tablemode#spreadsheet#formula#Add("Sum(1:-1)")
- Expect tablemode#spreadsheet#cell#GetCell() == '250.0'
- call cursor(8, 15)
- Expect getline('.') == '/* tmf: $4,2=Sum(1:3); $5,2=Sum(1:-1) */'
- end
- end
-
- describe 'Evaluate Formula'
- before
- new
- read t/fixtures/formula/formula.txt
- end
-
- it 'should evaluate the formula successfull'
- call cursor(6, 15)
- call tablemode#spreadsheet#formula#EvaluateFormulaLine()
- Expect &modified == 1
- Expect tablemode#spreadsheet#cell#GetCell() == '125.0'
- end
- end
-end
diff --git a/vim/bundle/vim-table-mode/t/spreadsheet.vim b/vim/bundle/vim-table-mode/t/spreadsheet.vim
deleted file mode 100644
index 093475c..0000000
--- a/vim/bundle/vim-table-mode/t/spreadsheet.vim
+++ /dev/null
@@ -1,105 +0,0 @@
-" vim: fdm=indent
-source t/config/options.vim
-
-describe 'spreadsheet'
- describe 'API'
- before
- new
- read t/fixtures/sample.txt
- end
-
- it 'should return the row count'
- Expect tablemode#spreadsheet#RowCount(2) == 2
- Expect tablemode#spreadsheet#RowCount(3) == 2
- end
-
- it 'should return the row number'
- Expect tablemode#spreadsheet#RowNr(2) == 1
- Expect tablemode#spreadsheet#RowNr(3) == 2
- end
-
- it 'should return the column count'
- Expect tablemode#spreadsheet#ColumnCount(2) == 2
- Expect tablemode#spreadsheet#ColumnCount(3) == 2
- end
-
- it 'should return the column number'
- call cursor(2,3)
- Expect tablemode#spreadsheet#ColumnNr('.') == 1
- call cursor(2,12)
- Expect tablemode#spreadsheet#ColumnNr('.') == 2
- end
-
- it 'should return true when in the first cell'
- call cursor(2,3)
- Expect tablemode#spreadsheet#IsFirstCell() to_be_true
- call cursor(2,12)
- Expect tablemode#spreadsheet#IsFirstCell() to_be_false
- end
-
- it 'should return true when in the last cell'
- call cursor(2,3)
- Expect tablemode#spreadsheet#IsLastCell() to_be_false
- call cursor(2,12)
- Expect tablemode#spreadsheet#IsLastCell() to_be_true
- end
-
- it 'should return the line number of the first row'
- Expect tablemode#spreadsheet#GetFirstRow(2) == 2
- Expect tablemode#spreadsheet#GetFirstRow(3) == 2
- end
-
- it 'should return the line nuber of the last row'
- Expect tablemode#spreadsheet#GetLastRow(2) == 3
- Expect tablemode#spreadsheet#GetLastRow(3) == 3
- end
-
- describe 'Math'
- before
- new
- read t/fixtures/cell/sample.txt
- end
-
- it 'should return the sum of cell range'
- call cursor(1,3)
- Expect tablemode#spreadsheet#Sum('1:2') == 4.0
- Expect tablemode#spreadsheet#Sum('1,1:1,2') == 3.0
- Expect tablemode#spreadsheet#Sum('1,1:2,2') == 10.0
- call cursor(2,7)
- Expect tablemode#spreadsheet#Sum('1:2') == 6.0
- Expect tablemode#spreadsheet#Sum('2,1:2,2') == 7.0
- end
-
- it 'should return the average of cell range'
- call cursor(1,3)
- Expect tablemode#spreadsheet#Average('1:2') == 2.0
- Expect tablemode#spreadsheet#Average('1,1:1,2') == 1.5
- Expect tablemode#spreadsheet#Average('1,1:2,2') == 5.0
- call cursor(2,7)
- Expect tablemode#spreadsheet#Average('1:2') == 3.0
- Expect tablemode#spreadsheet#Average('2,1:2,2') == 3.5
- end
- end
- end
-
- describe 'Manipulations'
- before
- new
- normal! ggdG
- read t/fixtures/sample.txt
- call cursor(2, 3)
- end
-
- it 'should delete a row successfully'
- Expect tablemode#spreadsheet#RowCount('.') == 2
- call tablemode#spreadsheet#DeleteRow()
- Expect tablemode#spreadsheet#RowCount('.') == 1
- end
-
- it 'should successfully delete column'
- Expect tablemode#spreadsheet#ColumnCount('.') == 2
- call tablemode#spreadsheet#DeleteColumn()
- Expect tablemode#spreadsheet#ColumnCount('.') == 1
- end
- end
-end
diff --git a/vim/bundle/vim-table-mode/t/table.vim b/vim/bundle/vim-table-mode/t/table.vim
deleted file mode 100644
index 516467c..0000000
--- a/vim/bundle/vim-table-mode/t/table.vim
+++ /dev/null
@@ -1,184 +0,0 @@
-" vim: fdm=indent
-source t/config/options.vim
-
-describe 'table'
- describe 'IsRow'
- before
- new
- normal! ggdG
- read t/fixtures/table/sample.txt
- end
-
- it 'should be true when on a table row'
- Expect tablemode#table#IsRow(2) to_be_true
- Expect tablemode#table#IsRow(3) to_be_true
- end
-
- it 'should be false when not on a table row'
- Expect tablemode#table#IsRow(1) to_be_false
- Expect tablemode#table#IsRow(4) to_be_false
- end
- end
-
- describe 'IsBorder'
- before
- new
- normal! ggdG
- read t/fixtures/table/sample_with_header.txt
- end
-
- it 'should be true on a table border'
- Expect tablemode#table#IsBorder(1) to_be_true
- Expect tablemode#table#IsBorder(3) to_be_true
- Expect tablemode#table#IsBorder(6) to_be_true
- end
-
- it 'should be false when not on a table border'
- Expect tablemode#table#IsBorder(2) to_be_false
- Expect tablemode#table#IsBorder(4) to_be_false
- Expect tablemode#table#IsBorder(5) to_be_false
- end
- end
-
- describe 'IsTable'
- before
- new normal! ggdG
- read t/fixtures/table/sample_with_header.txt
- end
-
- it 'should be true on a table row'
- Expect tablemode#table#IsTable(2) to_be_true
- Expect tablemode#table#IsTable(4) to_be_true
- Expect tablemode#table#IsTable(5) to_be_true
- end
-
- it 'should be true when on a table border'
- Expect tablemode#table#IsTable(1) to_be_true
- Expect tablemode#table#IsTable(3) to_be_true
- Expect tablemode#table#IsTable(6) to_be_true
- end
-
- it 'should not be true when not on a table'
- Expect tablemode#table#IsTable(7) to_be_false
- end
- end
-
- describe 'IsHeader'
- before
- new
- normal! ggdG
- read t/fixtures/table/sample_with_header.txt
- end
-
- it 'should be true on the table header'
- Expect tablemode#table#IsHeader(2) to_be_true
- end
-
- it 'should be false anywhere else'
- Expect tablemode#table#IsHeader(1) to_be_false
- Expect tablemode#table#IsHeader(4) to_be_false
- Expect tablemode#table#IsHeader(5) to_be_false
- Expect tablemode#table#IsHeader(6) to_be_false
- Expect tablemode#table#IsHeader(7) to_be_false
- end
- end
-
- describe 'AddBorder'
- before
- new
- normal! ggdG
- read t/fixtures/table/sample_for_header.txt
- end
-
- it 'should add border to line'
- call tablemode#table#AddBorder(2)
- Expect tablemode#table#IsHeader(1) to_be_true
- Expect tablemode#table#IsBorder(2) to_be_true
- end
-
- describe 'for unicode'
- before
- new
- normal! ggdG
- read t/fixtures/table/sample_for_header_unicode.txt
- end
-
- it 'should add border to line'
- call tablemode#table#AddBorder(1)
- call tablemode#table#AddBorder(3)
- call tablemode#table#AddBorder(5)
- call tablemode#table#AddBorder(7)
- call tablemode#table#AddBorder(9)
-
- Expect tablemode#table#IsBorder(1) to_be_true
- Expect tablemode#utils#StrDisplayWidth(getline(1)) == tablemode#utils#StrDisplayWidth(getline(2))
- Expect tablemode#table#IsBorder(3) to_be_true
- Expect tablemode#utils#StrDisplayWidth(getline(3)) == tablemode#utils#StrDisplayWidth(getline(4))
- Expect tablemode#table#IsBorder(5) to_be_true
- Expect tablemode#utils#StrDisplayWidth(getline(5)) == tablemode#utils#StrDisplayWidth(getline(6))
- Expect tablemode#table#IsBorder(7) to_be_true
- Expect tablemode#utils#StrDisplayWidth(getline(7)) == tablemode#utils#StrDisplayWidth(getline(8))
- Expect tablemode#table#IsBorder(9) to_be_true
- Expect tablemode#utils#StrDisplayWidth(getline(9)) == tablemode#utils#StrDisplayWidth(getline(8))
- end
- end
- end
-
- describe 'Realign'
- describe 'without header alignments'
- describe 'for simple'
- before
- new
- normal! ggdG
- read t/fixtures/table/sample_realign_before.txt
- end
-
- it 'should be aligned properly'
- call tablemode#table#Realign(1)
- Expect getline(1,'$') == readfile('t/fixtures/table/sample_realign_after.txt')
- end
- end
-
- describe 'for unicode'
- before
- new
- normal! ggdG
- read t/fixtures/table/sample_realign_unicode_before.txt
- end
-
- it 'should be aligned properly'
- call tablemode#table#Realign(1)
- Expect getline(1,'$') == readfile('t/fixtures/table/sample_realign_unicode_after.txt')
- end
- end
- end
-
- describe 'with header alignments'
- describe 'for simple'
- before
- new
- normal! ggdG
- read t/fixtures/table/sample_header_realign_before.txt
- end
-
- it 'should be aligned properly'
- call tablemode#table#Realign(1)
- Expect getline(1,'$') == readfile('t/fixtures/table/sample_header_realign_after.txt')
- end
- end
-
- describe 'for unicode'
- before
- new
- normal! ggdG
- read t/fixtures/table/sample_header_realign_unicode_before.txt
- end
-
- it 'should be aligned properly'
- call tablemode#table#Realign(1)
- Expect getline(1,'$') == readfile('t/fixtures/table/sample_header_realign_unicode_after.txt')
- end
- end
- end
- end
-end
diff --git a/vim/bundle/vim-table-mode/t/tablemode.vim b/vim/bundle/vim-table-mode/t/tablemode.vim
deleted file mode 100644
index 132c4bb..0000000
--- a/vim/bundle/vim-table-mode/t/tablemode.vim
+++ /dev/null
@@ -1,56 +0,0 @@
-" vim: fdm=indent
-source t/config/options.vim
-
-describe 'tablemode'
- describe 'Activation'
- describe 'tablemode#Enable()'
- before
- call tablemode#Enable()
- end
-
- it 'should enable table mode'
- Expect b:table_mode_active to_be_true
- end
- end
-
- describe 'tablemode#Disable()'
- before
- call tablemode#Disable()
- end
-
- it 'should disable table mode'
- Expect b:table_mode_active to_be_false
- end
- end
-
- describe 'tablemode#Toggle()'
- it 'should toggle table mode'
- call tablemode#Toggle()
- Expect b:table_mode_active to_be_true
- call tablemode#Toggle()
- Expect b:table_mode_active to_be_false
- end
- end
- end
-
- describe 'Tableize'
- before
- new
- read t/fixtures/tableize.txt
- end
-
- it 'should tableize with default delimiter'
- :2,3call tablemode#TableizeRange('')
- Expect tablemode#table#IsRow(2) to_be_true
- Expect tablemode#spreadsheet#RowCount(2) == 2
- Expect tablemode#spreadsheet#ColumnCount(2) == 3
- end
-
- it 'should tableize with given delimiter'
- :2,3call tablemode#TableizeRange('/;')
- Expect tablemode#table#IsRow(2) to_be_true
- Expect tablemode#spreadsheet#RowCount(2) == 2
- Expect tablemode#spreadsheet#ColumnCount(2) == 2
- end
- end
-end
diff --git a/vim/bundle/vim-table-mode/t/utils.vim b/vim/bundle/vim-table-mode/t/utils.vim
deleted file mode 100644
index 3bfff19..0000000
--- a/vim/bundle/vim-table-mode/t/utils.vim
+++ /dev/null
@@ -1,45 +0,0 @@
-" vim: fdm=indent
-source t/config/options.vim
-
-describe 'utils'
- describe 'line'
- it 'should return the current line number'
- Expect tablemode#utils#line('.') == line('.')
- end
-
- it 'should return the line number itself if it is a number'
- Expect tablemode#utils#line(1) == 1
- end
- end
-
- describe 'strip'
- it 'should strip all initial or trailing whitespace from a string'
- let string = ' This is awesome '
- Expect tablemode#utils#strip(string) == 'This is awesome'
- end
- end
-
- describe 'strlen'
- it 'should return the length of a string correctly'
- let string = 'this is a test'
- Expect tablemode#utils#strlen(string) == 14
- end
-
- it 'should return the length of a unicode string correctly'
- let string = '測試 is good.'
- Expect tablemode#utils#strlen(string) == 11
- end
- end
-
- describe 'strdisplaywidth'
- it 'should return the display width of a string correctly'
- let string = 'this is a test'
- Expect tablemode#utils#StrDisplayWidth(string) == 14
- end
-
- it 'should return the display width of a unicode string correctly'
- let string = '測試 is good.'
- Expect tablemode#utils#StrDisplayWidth(string) == 13
- end
- end
-end