diff options
author | Karel Kočí <cynerd@email.cz> | 2016-06-30 16:03:25 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2016-06-30 16:03:25 +0200 |
commit | e573b3020c032400eed60b649a2cbf55266e6bb0 (patch) | |
tree | 8f572394ac8433529c7a8e70d160a2fbe8268b4e /vim/bundle/vim-table-mode/t/utils.vim | |
parent | b8c667bd64b3edd38d56c63c5bd1db53a23b4499 (diff) | |
download | myconfigs-e573b3020c032400eed60b649a2cbf55266e6bb0.tar.gz myconfigs-e573b3020c032400eed60b649a2cbf55266e6bb0.tar.bz2 myconfigs-e573b3020c032400eed60b649a2cbf55266e6bb0.zip |
Add current configurations from old repository
Diffstat (limited to 'vim/bundle/vim-table-mode/t/utils.vim')
-rw-r--r-- | vim/bundle/vim-table-mode/t/utils.vim | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/vim/bundle/vim-table-mode/t/utils.vim b/vim/bundle/vim-table-mode/t/utils.vim new file mode 100644 index 0000000..3bfff19 --- /dev/null +++ b/vim/bundle/vim-table-mode/t/utils.vim @@ -0,0 +1,45 @@ +" 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 |