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/lightline.vim/test/concatenate.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/lightline.vim/test/concatenate.vim')
-rw-r--r-- | vim/bundle/lightline.vim/test/concatenate.vim | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/vim/bundle/lightline.vim/test/concatenate.vim b/vim/bundle/lightline.vim/test/concatenate.vim new file mode 100644 index 0000000..6fd2723 --- /dev/null +++ b/vim/bundle/lightline.vim/test/concatenate.vim @@ -0,0 +1,90 @@ +let s:suite = themis#suite('concatenate') +let s:assert = themis#helper('assert') + +function! s:suite.before_each() + let g:lightline = { 'subseparator': { 'left': '>', 'right': '<' } } + call lightline#init() +endfunction + +function! s:suite.nil() + call s:assert.equals(lightline#concatenate([], 0), '') + call s:assert.equals(lightline#concatenate([], 1), '') +endfunction + +function! s:suite.one() + call s:assert.equals(lightline#concatenate(['foo'], 0), 'foo') + call s:assert.equals(lightline#concatenate(['foo'], 1), 'foo') +endfunction + +function! s:suite.two() + call s:assert.equals(lightline#concatenate(['foo', 'bar'], 0), 'foo > bar') + call s:assert.equals(lightline#concatenate(['foo', 'bar'], 1), 'foo < bar') +endfunction + +function! s:suite.three() + call s:assert.equals(lightline#concatenate(['foo', 'bar', 'baz'], 0), 'foo > bar > baz') + call s:assert.equals(lightline#concatenate(['foo', 'bar', 'baz'], 1), 'foo < bar < baz') +endfunction + +function! s:suite.one_empty() + call s:assert.equals(lightline#concatenate([''], 0), '') + call s:assert.equals(lightline#concatenate([''], 1), '') +endfunction + +function! s:suite.two_empty_left() + call s:assert.equals(lightline#concatenate(['', 'bar'], 0), 'bar') + call s:assert.equals(lightline#concatenate(['', 'bar'], 1), 'bar') +endfunction + +function! s:suite.two_empty_right() + call s:assert.equals(lightline#concatenate(['foo', ''], 0), 'foo') + call s:assert.equals(lightline#concatenate(['foo', ''], 1), 'foo') +endfunction + +function! s:suite.two_empty_both() + call s:assert.equals(lightline#concatenate(['', ''], 0), '') + call s:assert.equals(lightline#concatenate(['', ''], 1), '') +endfunction + +function! s:suite.three_empty_left() + call s:assert.equals(lightline#concatenate(['', 'bar', 'baz'], 0), 'bar > baz') + call s:assert.equals(lightline#concatenate(['', 'bar', 'baz'], 1), 'bar < baz') +endfunction + +function! s:suite.three_empty_middle() + call s:assert.equals(lightline#concatenate(['foo', '', 'baz'], 0), 'foo > baz') + call s:assert.equals(lightline#concatenate(['foo', '', 'baz'], 1), 'foo < baz') +endfunction + +function! s:suite.three_empty_right() + call s:assert.equals(lightline#concatenate(['foo', 'bar', ''], 0), 'foo > bar') + call s:assert.equals(lightline#concatenate(['foo', 'bar', ''], 1), 'foo < bar') +endfunction + +function! s:suite.three_empty_middle_right() + call s:assert.equals(lightline#concatenate(['foo', '', ''], 0), 'foo') + call s:assert.equals(lightline#concatenate(['foo', '', ''], 1), 'foo') +endfunction + +function! s:suite.three_empty_left_right() + call s:assert.equals(lightline#concatenate(['', 'bar', ''], 0), 'bar') + call s:assert.equals(lightline#concatenate(['', 'bar', ''], 1), 'bar') +endfunction + +function! s:suite.three_empty_left_middle() + call s:assert.equals(lightline#concatenate(['', '', 'baz'], 0), 'baz') + call s:assert.equals(lightline#concatenate(['', '', 'baz'], 1), 'baz') +endfunction + +function! s:suite.three_empty_all() + call s:assert.equals(lightline#concatenate(['', '', ''], 0), '') + call s:assert.equals(lightline#concatenate(['', '', ''], 1), '') +endfunction + +function! s:suite.keep_original() + let xs = ['', 'bar', ''] + call s:assert.equals(lightline#concatenate(xs, 0), 'bar') + call s:assert.equals(xs, ['', 'bar', '']) + call s:assert.equals(lightline#concatenate(xs, 1), 'bar') + call s:assert.equals(xs, ['', 'bar', '']) +endfunction |