aboutsummaryrefslogtreecommitdiff
path: root/vim/bundle/lightline.vim/test
diff options
context:
space:
mode:
Diffstat (limited to 'vim/bundle/lightline.vim/test')
-rw-r--r--vim/bundle/lightline.vim/test/.themisrc20
-rw-r--r--vim/bundle/lightline.vim/test/concatenate.vim90
-rw-r--r--vim/bundle/lightline.vim/test/error.vim15
-rw-r--r--vim/bundle/lightline.vim/test/expand.vim612
-rw-r--r--vim/bundle/lightline.vim/test/highlight.vim171
-rw-r--r--vim/bundle/lightline.vim/test/link.vim131
-rw-r--r--vim/bundle/lightline.vim/test/mode.vim14
-rw-r--r--vim/bundle/lightline.vim/test/onetab.vim98
-rw-r--r--vim/bundle/lightline.vim/test/subseparator.vim302
-rw-r--r--vim/bundle/lightline.vim/test/tabline.vim67
-rw-r--r--vim/bundle/lightline.vim/test/tabs.vim99
-rw-r--r--vim/bundle/lightline.vim/test/toggle.vim37
-rw-r--r--vim/bundle/lightline.vim/test/uniq.vim46
13 files changed, 1702 insertions, 0 deletions
diff --git a/vim/bundle/lightline.vim/test/.themisrc b/vim/bundle/lightline.vim/test/.themisrc
new file mode 100644
index 0000000..c226c08
--- /dev/null
+++ b/vim/bundle/lightline.vim/test/.themisrc
@@ -0,0 +1,20 @@
+let s:sids = {}
+function! s:sid(path) abort
+ if has_key(s:sids, a:path)
+ return s:sids[a:path]
+ endif
+ redir => scriptnames
+ silent! scriptnames
+ redir END
+ for line in split(scriptnames, '\n')
+ if line =~# a:path
+ let sid = matchstr(line, '\v^\s*\zs\d+\ze')
+ let s:sids[a:path] = sid
+ return sid
+ endif
+ endfor
+endfunction
+
+function! SID(name) abort
+ return function(printf("\<SNR>%d_%s", s:sid('autoload/lightline.vim'), a:name))
+endfunction
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
diff --git a/vim/bundle/lightline.vim/test/error.vim b/vim/bundle/lightline.vim/test/error.vim
new file mode 100644
index 0000000..8fdabf4
--- /dev/null
+++ b/vim/bundle/lightline.vim/test/error.vim
@@ -0,0 +1,15 @@
+let s:suite = themis#suite('error')
+let s:assert = themis#helper('assert')
+
+function! s:message() abort
+ redir => messages
+ silent! messages
+ redir END
+ return split(messages, '\n')[-1]
+endfunction
+
+function! s:suite.error()
+ let message = 'An error occurred.'
+ call lightline#error(message)
+ call s:assert.equals(s:message(), 'lightline.vim: ' . message)
+endfunction
diff --git a/vim/bundle/lightline.vim/test/expand.vim b/vim/bundle/lightline.vim/test/expand.vim
new file mode 100644
index 0000000..c2fc0ab
--- /dev/null
+++ b/vim/bundle/lightline.vim/test/expand.vim
@@ -0,0 +1,612 @@
+let s:suite = themis#suite('expand')
+let s:assert = themis#helper('assert')
+
+function! s:expand(...)
+ return call(SID('expand'), a:000)
+endfunction
+
+function! s:suite.expand()
+ let g:lightline = {}
+ call lightline#init()
+ call s:assert.equals(s:expand([]),
+ \ [[], [], ['0']])
+endfunction
+
+function! s:suite.default()
+ let g:lightline = {}
+ call lightline#init()
+ call s:assert.equals(s:expand([['mode', 'paste'], ['readonly', 'filename', 'modified']]),
+ \ [[['mode', 'paste'], ['readonly', 'filename', 'modified']], [[0, 0], [0, 0, 0]], ['0', '1', '2']])
+endfunction
+
+function! s:suite.custom()
+ function! Custom()
+ return [ ['left'], ['middle'], ['right'] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['left', 'middle', 'right'], ['modified']], [[0, 0], [1, 1, 1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'left', 'middle', 'right', 'modified']], [[0, 0, 1, 1, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type()
+ function! Custom()
+ return [ ['left'], ['middle'], ['right'] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['left'], ['middle'], ['right'], ['modified']], [[0, 0], [1], [1], [1], [0]], ['0', '1', 'custom', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'left'], ['middle'], ['right', 'modified']], [[0, 0, 1], [1], [1, 0]], ['0', 'custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.multiple()
+ function! Custom()
+ return [ ['x0', 'x1', 'x2'], ['y0', 'y1', 'y2'], ['z0', 'z1', 'z2'] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['x0', 'x1', 'x2', 'y0', 'y1', 'y2', 'z0', 'z1', 'z2'], ['modified']], [[0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'x0', 'x1', 'x2', 'y0', 'y1', 'y2', 'z0', 'z1', 'z2', 'modified']], [[0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.multiple_type()
+ function! Custom()
+ return [ ['x0', 'x1', 'x2'], ['y0', 'y1', 'y2'], ['z0', 'z1', 'z2'] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['x0', 'x1', 'x2'], ['y0', 'y1', 'y2'], ['z0', 'z1', 'z2'], ['modified']], [[0, 0], [1, 1, 1], [1, 1, 1], [1, 1, 1], [0]], ['0', '1', 'custom', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'x0', 'x1', 'x2'], ['y0', 'y1', 'y2'], ['z0', 'z1', 'z2', 'modified']], [[0, 0, 1, 1, 1], [1, 1, 1], [1, 1, 1, 0]], ['0', 'custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.flatten()
+ function! Custom()
+ return [ 'left', 'middle', 'right' ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['left', 'middle', 'right'], ['modified']], [[0, 0], [1, 1, 1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'left', 'middle', 'right', 'modified']], [[0, 0, 1, 1, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type_flatten()
+ function! Custom()
+ return [ 'left', 'middle', 'right' ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['left'], ['middle'], ['right'], ['modified']], [[0, 0], [1], [1], [1], [0]], ['0', '1', 'custom', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'left'], ['middle'], ['right', 'modified']], [[0, 0, 1], [1], [1, 0]], ['0', 'custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_string()
+ function! Custom()
+ return 'custom'
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'custom', 'modified']], [[0, 0, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type_string()
+ function! Custom()
+ return 'custom'
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], ['0', 'custom', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], ['0', 'custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_void_string()
+ function! Custom()
+ return ''
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['modified']], [[0, 0], [0]], ['0', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type_void_string()
+ function! Custom()
+ return ''
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['modified']], [[0, 0], [0]], ['0', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_number()
+ function! Custom()
+ return 24
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['24'], ['modified']], [[0, 0], [1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', '24', 'modified']], [[0, 0, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type_number()
+ function! Custom()
+ return 24
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['24'], ['modified']], [[0, 0], [1], [0]], ['0', 'custom', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename'], ['24'], ['modified']], [[0, 0], [1], [0]], ['0', 'custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_void_string_array()
+ function! Custom()
+ return ['', '', '']
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['modified']], [[0, 0], [0]], ['0', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type_void_string_array()
+ function! Custom()
+ return ['', '', '']
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['modified']], [[0, 0], [0]], ['0', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_void_string_array_2()
+ function! Custom()
+ return [[''], [''], ['']]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['modified']], [[0, 0], [0]], ['0', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type_void_string_array_2()
+ function! Custom()
+ return [[''], [''], ['']]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['modified']], [[0, 0], [0]], ['0', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_void_string_array_3()
+ function! Custom()
+ return ['', 'custom', '']
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'custom', 'modified']], [[0, 0, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type_void_string_array_3()
+ function! Custom()
+ return ['', 'custom', '']
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], ['0', 'custom', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], ['0', 'custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_void_string_array_4()
+ function! Custom()
+ return [[''], ['custom'], ['']]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'custom', 'modified']], [[0, 0, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type_void_string_array_4()
+ function! Custom()
+ return [[''], ['custom'], ['']]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], ['0', 'custom', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], ['0', 'custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_left_nil()
+ function! Custom()
+ return [ [], ['y0', 'y1'], ['z0', 'z1'] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['filename'], ['custom'], ['modified']]),
+ \ [[['filename'], ['y0', 'y1', 'z0', 'z1'], ['modified']], [[0], [1, 1, 1, 1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['filename', 'custom', 'modified']]),
+ \ [[['filename', 'y0', 'y1', 'z0', 'z1', 'modified']], [[0, 1, 1, 1, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type_left_nil()
+ function! Custom()
+ return [ [], ['y0', 'y1'], ['z0', 'z1'] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['filename'], ['custom'], ['modified']]),
+ \ [[['filename'], ['y0', 'y1'], ['z0', 'z1'], ['modified']], [[0], [1, 1], [1, 1], [0]], ['0', 'custom', '1', '2', '3']])
+ call s:assert.equals(s:expand([['filename', 'custom', 'modified']]),
+ \ [[['filename'], ['y0', 'y1'], ['z0', 'z1', 'modified']], [[0], [1, 1], [1, 1, 0]], ['0', 'custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_right_nil()
+ function! Custom()
+ return [ ['x0', 'x1'], ['y0', 'y1'], [] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['filename'], ['custom'], ['modified']]),
+ \ [[['filename'], ['x0', 'x1', 'y0', 'y1'], ['modified']], [[0], [1, 1, 1, 1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['filename', 'custom', 'modified']]),
+ \ [[['filename', 'x0', 'x1', 'y0', 'y1', 'modified']], [[0, 1, 1, 1, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type_right_nil()
+ function! Custom()
+ return [ ['x0', 'x1'], ['y0', 'y1'], [] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['filename'], ['custom'], ['modified']]),
+ \ [[['filename'], ['x0', 'x1'], ['y0', 'y1'], ['modified']], [[0], [1, 1], [1, 1], [0]], ['0', '1', 'custom', '2', '3']])
+ call s:assert.equals(s:expand([['filename', 'custom', 'modified']]),
+ \ [[['filename', 'x0', 'x1'], ['y0', 'y1'], ['modified']], [[0, 1, 1], [1, 1], [0]], ['0', 'custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_one()
+ function! Custom()
+ return [ 'left' ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['left'], ['modified']], [[0, 0], [1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'left', 'modified']], [[0, 0, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type_one()
+ function! Custom()
+ return [ 'left' ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['left'], ['modified']], [[0, 0], [1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'left', 'modified']], [[0, 0, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_two()
+ function! Custom()
+ return [ 'left', 'middle']
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['left', 'middle'], ['modified']], [[0, 0], [1, 1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'left', 'middle', 'modified']], [[0, 0, 1, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type_two()
+ function! Custom()
+ return [ 'left', 'middle' ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['left'], ['middle'], ['modified']], [[0, 0], [1], [1], [0]], ['0', '1', 'custom', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'left'], ['middle'], ['modified']], [[0, 0, 1], [1], [0]], ['0', 'custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_mixed()
+ function! Custom()
+ return ['left', { 'custom': 24 }, [function('tr')]]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['left', '{''custom'': 24}', 'function(''tr'')'], ['modified']], [[0, 0], [1, 1, 1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'left', '{''custom'': 24}', 'function(''tr'')', 'modified']], [[0, 0, 1, 1, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type_mixed()
+ function! Custom()
+ return ['left', { 'custom': 24 }, [function('tr')]]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['left'], ['{''custom'': 24}'], ['function(''tr'')'], ['modified']], [[0, 0], [1], [1], [1], [0]], ['0', '1', 'custom', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'left'], ['{''custom'': 24}'], ['function(''tr'')', 'modified']], [[0, 0, 1], [1], [1, 0]], ['0', 'custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_mixed_2()
+ function! Custom()
+ return [['left', ''], ['', { 'custom': 24 }, ''], [[function('tr')], '']]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['left', '{''custom'': 24}', '[function(''tr'')]'], ['modified']], [[0, 0], [1, 1, 1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'left', '{''custom'': 24}', '[function(''tr'')]', 'modified']], [[0, 0, 1, 1, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type_mixed_2()
+ function! Custom()
+ return [['left', ''], ['', { 'custom': 24 }, ''], [[function('tr')], '']]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['left'], ['{''custom'': 24}'], ['[function(''tr'')]'], ['modified']], [[0, 0], [1], [1], [1], [0]], ['0', '1', 'custom', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'left'], ['{''custom'': 24}'], ['[function(''tr'')]', 'modified']], [[0, 0, 1], [1], [1, 0]], ['0', 'custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_error()
+ function! Custom()
+ throw 'error'
+ return 'custom'
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['modified']], [[0, 0], [0]], ['0', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type_error()
+ function! Custom()
+ throw 'error'
+ return 'custom'
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['modified']], [[0, 0], [0]], ['0', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.notfound()
+ let g:lightline = { 'component_expand': { 'custom': 'NotFound' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['modified']], [[0, 0], [0]], ['0', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
+endfunction
+
+function! s:suite.custom_type_notfound()
+ let g:lightline = { 'component_expand': { 'custom': 'NotFound' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['modified']], [[0, 0], [0]], ['0', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
+endfunction
+
+function! s:suite.duplicated_left_nil()
+ function! Custom()
+ return [ [], ['y0', 'y1'], ['z0', 'z1'] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['filename'], ['custom', 'custom'], ['modified']]),
+ \ [[['filename'], ['y0', 'y1', 'z0', 'z1', 'y0', 'y1', 'z0', 'z1'], ['modified']], [[0], [1, 1, 1, 1, 1, 1, 1, 1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['filename', 'custom', 'custom', 'modified']]),
+ \ [[['filename', 'y0', 'y1', 'z0', 'z1', 'y0', 'y1', 'z0', 'z1', 'modified']], [[0, 1, 1, 1, 1, 1, 1, 1, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.duplicated_type_left_nil()
+ function! Custom()
+ return [ [], ['y0', 'y1'], ['z0', 'z1'] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['filename'], ['custom', 'custom'], ['modified']]),
+ \ [[['filename'], ['y0', 'y1'], ['z0', 'z1'], ['y0', 'y1'], ['z0', 'z1'], ['modified']], [[0], [1, 1], [1, 1], [1, 1], [1, 1], [0]], ['0', 'custom', '1', 'custom', '1', '2', '3']])
+ call s:assert.equals(s:expand([['filename', 'custom', 'custom', 'modified']]),
+ \ [[['filename'], ['y0', 'y1'], ['z0', 'z1'], ['y0', 'y1'], ['z0', 'z1', 'modified']], [[0], [1, 1], [1, 1], [1, 1], [1, 1, 0]], ['0', 'custom', '0', 'custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.duplicated_right_nil()
+ function! Custom()
+ return [ ['x0', 'x1'], ['y0', 'y1'], [] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['filename'], ['custom', 'custom'], ['modified']]),
+ \ [[['filename'], ['x0', 'x1', 'y0', 'y1', 'x0', 'x1', 'y0', 'y1'], ['modified']], [[0], [1, 1, 1, 1, 1, 1, 1, 1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['filename', 'custom', 'custom', 'modified']]),
+ \ [[['filename', 'x0', 'x1', 'y0', 'y1', 'x0', 'x1', 'y0', 'y1', 'modified']], [[0, 1, 1, 1, 1, 1, 1, 1, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.duplicated_type_right_nil()
+ function! Custom()
+ return [ ['x0', 'x1'], ['y0', 'y1'], [] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['filename'], ['custom', 'custom'], ['modified']]),
+ \ [[['filename'], ['x0', 'x1'], ['y0', 'y1'], ['x0', 'x1'], ['y0', 'y1'], ['modified']], [[0], [1, 1], [1, 1], [1, 1], [1, 1], [0]], ['0', '1', 'custom', '1', 'custom', '2', '3']])
+ call s:assert.equals(s:expand([['filename', 'custom', 'custom', 'modified']]),
+ \ [[['filename', 'x0', 'x1'], ['y0', 'y1'], ['x0', 'x1'], ['y0', 'y1'], ['modified']], [[0, 1, 1], [1, 1], [1, 1], [1, 1], [0]], ['0', 'custom', '0', 'custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.duplicated_both_nil()
+ function! Custom()
+ return [ [], ['y0', 'y1'], [] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['filename'], ['custom', 'custom'], ['modified']]),
+ \ [[['filename'], ['y0', 'y1', 'y0', 'y1'], ['modified']], [[0], [1, 1, 1, 1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['filename', 'custom', 'custom', 'modified']]),
+ \ [[['filename', 'y0', 'y1', 'y0', 'y1', 'modified']], [[0, 1, 1, 1, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.duplicated_type_both_nil()
+ function! Custom()
+ return [ [], ['y0', 'y1'], [] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['filename'], ['custom', 'custom'], ['modified']]),
+ \ [[['filename'], ['y0', 'y1', 'y0', 'y1'], ['modified']], [[0], [1, 1, 1, 1], [0]], ['0', 'custom', '2', '3']])
+ call s:assert.equals(s:expand([['filename', 'custom', 'custom', 'modified']]),
+ \ [[['filename'], ['y0', 'y1', 'y0', 'y1'], ['modified']], [[0], [1, 1, 1, 1], [0]], ['0', 'custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.duplicated_both_nil_left_most()
+ function! Custom()
+ return [ [], ['y0', 'y1'], [] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['custom', 'custom'], ['modified']]),
+ \ [[['y0', 'y1', 'y0', 'y1'], ['modified']], [[1, 1, 1, 1], [0]], ['0', '1', '2']])
+ call s:assert.equals(s:expand([['custom', 'custom', 'modified']]),
+ \ [[['y0', 'y1', 'y0', 'y1', 'modified']], [[1, 1, 1, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.duplicated_type_both_nil_left_most()
+ function! Custom()
+ return [ [], ['y0', 'y1'], [] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['custom', 'custom'], ['modified']]),
+ \ [[['y0', 'y1', 'y0', 'y1'], ['modified']], [[1, 1, 1, 1], [0]], ['custom', '1', '2']])
+ call s:assert.equals(s:expand([['custom', 'custom', 'modified']]),
+ \ [[['y0', 'y1', 'y0', 'y1'], ['modified']], [[1, 1, 1, 1], [0]], ['custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.duplicated_both_nil_right_most()
+ function! Custom()
+ return [ [], ['y0', 'y1'], [] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['filename'], ['custom', 'custom']]),
+ \ [[['filename'], ['y0', 'y1', 'y0', 'y1']], [[0], [1, 1, 1, 1]], ['0', '1', '2']])
+ call s:assert.equals(s:expand([['filename', 'custom', 'custom']]),
+ \ [[['filename', 'y0', 'y1', 'y0', 'y1']], [[0, 1, 1, 1, 1]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.duplicated_type_both_nil_right_most()
+ function! Custom()
+ return [ [], ['y0', 'y1'], [] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['filename'], ['custom', 'custom']]),
+ \ [[['filename'], ['y0', 'y1', 'y0', 'y1']], [[0], [1, 1, 1, 1]], ['0', 'custom', '2']])
+ call s:assert.equals(s:expand([['filename', 'custom', 'custom']]),
+ \ [[['filename'], ['y0', 'y1', 'y0', 'y1']], [[0], [1, 1, 1, 1]], ['0', 'custom', '1']])
+ delfunction Custom
+endfunction
diff --git a/vim/bundle/lightline.vim/test/highlight.vim b/vim/bundle/lightline.vim/test/highlight.vim
new file mode 100644
index 0000000..fe5182a
--- /dev/null
+++ b/vim/bundle/lightline.vim/test/highlight.vim
@@ -0,0 +1,171 @@
+let s:suite = themis#suite('highlight')
+let s:assert = themis#helper('assert')
+
+function! s:suite.before_each()
+ hi clear
+endfunction
+
+function! s:hi(name)
+ redir => hi
+ silent! exec 'hi' a:name
+ redir END
+ return substitute(join(split(hi, "\n"), ''), ' \+', ' ', 'g')
+endfunction
+
+function! s:pattern(xs, ...) abort
+ let ys = a:0 ? a:xs[1:] : a:xs
+ let zs = get(a:000, 0, a:xs)
+ return 'ctermfg=' . ys[2] . ' ctermbg=' . zs[3] . '.*guifg=' . ys[0] . ' guibg=' . zs[1]
+endfunction
+
+function! s:suite.highlight()
+ let g:lightline = {}
+ call lightline#init()
+ call lightline#colorscheme()
+ let palette = lightline#palette()
+ call s:assert.match(s:hi('LightLineLeft_normal_0'), s:pattern(palette.normal.left[0]))
+ call s:assert.match(s:hi('LightLineLeft_normal_1'), s:pattern(palette.normal.left[1]))
+ call s:assert.match(s:hi('LightLineLeft_normal_2'), 'E411: highlight group not found\|cleared')
+ call s:assert.match(s:hi('LightLineRight_normal_0'), s:pattern(palette.normal.right[0]))
+ call s:assert.match(s:hi('LightLineRight_normal_1'), s:pattern(palette.normal.right[1]))
+ call s:assert.match(s:hi('LightLineRight_normal_2'), s:pattern(palette.normal.right[2]))
+ call s:assert.match(s:hi('LightLineRight_normal_3'), 'E411: highlight group not found\|cleared')
+ call s:assert.match(s:hi('LightLineMiddle_normal'), s:pattern(palette.normal.middle[0]))
+endfunction
+
+function! s:suite.insert()
+ let g:lightline = {}
+ call lightline#init()
+ call lightline#colorscheme()
+ call lightline#highlight('insert')
+ let palette = lightline#palette()
+ call s:assert.match(s:hi('LightLineLeft_insert_0'), s:pattern(palette.insert.left[0]))
+ call s:assert.match(s:hi('LightLineLeft_insert_1'), s:pattern(palette.insert.left[1]))
+ call s:assert.match(s:hi('LightLineLeft_insert_2'), 'E411: highlight group not found\|cleared')
+ call s:assert.match(s:hi('LightLineRight_insert_0'), s:pattern(palette.insert.right[0]))
+ call s:assert.match(s:hi('LightLineRight_insert_1'), s:pattern(palette.insert.right[1]))
+ call s:assert.match(s:hi('LightLineRight_insert_2'), s:pattern(palette.insert.right[2]))
+ call s:assert.match(s:hi('LightLineRight_insert_3'), 'E411: highlight group not found\|cleared')
+ call s:assert.match(s:hi('LightLineMiddle_insert'), s:pattern(palette.insert.middle[0]))
+endfunction
+
+
+function! s:suite.visual()
+ let g:lightline = {}
+ call lightline#init()
+ call lightline#colorscheme()
+ call lightline#highlight('visual')
+ let palette = lightline#palette()
+ call s:assert.match(s:hi('LightLineLeft_visual_0'), s:pattern(palette.visual.left[0]))
+ call s:assert.match(s:hi('LightLineLeft_visual_1'), s:pattern(palette.visual.left[1]))
+ call s:assert.match(s:hi('LightLineLeft_visual_2'), 'E411: highlight group not found\|cleared')
+ call s:assert.match(s:hi('LightLineRight_visual_0'), s:pattern(palette.normal.right[0]))
+ call s:assert.match(s:hi('LightLineRight_visual_1'), s:pattern(palette.normal.right[1]))
+ call s:assert.match(s:hi('LightLineRight_visual_2'), s:pattern(palette.normal.right[2]))
+ call s:assert.match(s:hi('LightLineRight_visual_3'), 'E411: highlight group not found\|cleared')
+ call s:assert.match(s:hi('LightLineMiddle_normal'), s:pattern(palette.normal.middle[0]))
+endfunction
+
+function! s:suite.replace()
+ let g:lightline = {}
+ call lightline#init()
+ call lightline#colorscheme()
+ call lightline#highlight('replace')
+ let palette = lightline#palette()
+ call s:assert.match(s:hi('LightLineLeft_replace_0'), s:pattern(palette.replace.left[0]))
+ call s:assert.match(s:hi('LightLineLeft_replace_1'), s:pattern(palette.replace.left[1]))
+ call s:assert.match(s:hi('LightLineLeft_replace_2'), 'E411: highlight group not found\|cleared')
+ call s:assert.match(s:hi('LightLineRight_replace_0'), s:pattern(palette.replace.right[0]))
+ call s:assert.match(s:hi('LightLineRight_replace_1'), s:pattern(palette.replace.right[1]))
+ call s:assert.match(s:hi('LightLineRight_replace_2'), s:pattern(palette.replace.right[2]))
+ call s:assert.match(s:hi('LightLineRight_replace_3'), 'E411: highlight group not found\|cleared')
+ call s:assert.match(s:hi('LightLineMiddle_replace'), s:pattern(palette.replace.middle[0]))
+endfunction
+
+function! s:suite.left_right()
+ let g:lightline = {
+ \ 'active': {
+ \ 'left': [ [ 'mode', 'paste' ], [ 'readonly' ], [ 'filename' ], [ 'modified' ] ],
+ \ 'right': [ [ 'lineinfo' ], [ 'percent' ], [ 'fileformat' ], [ 'fileencoding' ], [ 'filetype' ] ]
+ \ },
+ \ }
+ call lightline#init()
+ call lightline#colorscheme()
+ let palette = lightline#palette()
+ call s:assert.match(s:hi('LightLineLeft_normal_0'), s:pattern(palette.normal.left[0]))
+ call s:assert.match(s:hi('LightLineLeft_normal_1'), s:pattern(palette.normal.left[1]))
+ call s:assert.match(s:hi('LightLineLeft_normal_2'), s:pattern(palette.normal.middle[0]))
+ call s:assert.match(s:hi('LightLineLeft_normal_3'), s:pattern(palette.normal.middle[0]))
+ call s:assert.match(s:hi('LightLineLeft_normal_4'), 'E411: highlight group not found\|cleared')
+ call s:assert.match(s:hi('LightLineRight_normal_0'), s:pattern(palette.normal.right[0]))
+ call s:assert.match(s:hi('LightLineRight_normal_1'), s:pattern(palette.normal.right[1]))
+ call s:assert.match(s:hi('LightLineRight_normal_2'), s:pattern(palette.normal.right[2]))
+ call s:assert.match(s:hi('LightLineRight_normal_3'), s:pattern(palette.normal.middle[0]))
+ call s:assert.match(s:hi('LightLineRight_normal_4'), s:pattern(palette.normal.middle[0]))
+ call s:assert.match(s:hi('LightLineRight_normal_5'), 'E411: highlight group not found\|cleared')
+ call s:assert.match(s:hi('LightLineMiddle_normal'), s:pattern(palette.normal.middle[0]))
+endfunction
+
+function! s:suite.no_components()
+ let g:lightline = {
+ \ 'active': {
+ \ 'left': [],
+ \ 'right': []
+ \ },
+ \ 'inactive': {
+ \ 'left': [],
+ \ 'right': []
+ \ },
+ \ }
+ call lightline#init()
+ call lightline#colorscheme()
+ let palette = lightline#palette()
+ call s:assert.match(s:hi('LightLineLeft_normal_0'), s:pattern(palette.normal.left[0]))
+ call s:assert.match(s:hi('LightLineLeft_normal_1'), 'E411: highlight group not found\|cleared')
+ call s:assert.match(s:hi('LightLineRight_normal_0'), s:pattern(palette.normal.right[0]))
+ call s:assert.match(s:hi('LightLineRight_normal_1'), 'E411: highlight group not found\|cleared')
+ call s:assert.match(s:hi('LightLineMiddle_normal'), s:pattern(palette.normal.middle[0]))
+endfunction
+
+function! s:suite.subseparator()
+ let g:lightline = {
+ \ 'active': {
+ \ 'left': [ [ 'mode', 'paste' ], [ 'readonly' ], [ 'filename' ], [ 'modified' ] ],
+ \ 'right': [ [ 'lineinfo' ], [ 'percent' ], [ 'fileformat' ], [ 'fileencoding' ], [ 'filetype' ] ]
+ \ },
+ \ }
+ call lightline#init()
+ call lightline#colorscheme()
+ let palette = lightline#palette()
+ for i in range(4)
+ for j in range(5)
+ if i + 1 == j
+ call s:assert.match(s:hi(printf('LightLineLeft_normal_%s_%s', i, j)), s:pattern(get(palette.normal.left, i, palette.normal.middle[0]), get(palette.normal.left, j, palette.normal.middle[0])))
+ else
+ call s:assert.match(s:hi(printf('LightLineLeft_normal_%s_%s', i, j)), 'E411: highlight group not found\|cleared')
+ endif
+ endfor
+ endfor
+endfunction
+
+function! s:suite.component_type()
+ let g:lightline = { 'component_type': { 'error': 'error', 'warning': 'warning' } }
+ call lightline#init()
+ call lightline#colorscheme()
+ let palette = lightline#palette()
+ for type in ['error', 'warning']
+ call s:assert.match(s:hi(printf('LightLineLeft_normal_%s', type)), s:pattern(palette.normal[type][0]))
+ call s:assert.match(s:hi(printf('LightLineLeft_normal_0_%s', type)), s:pattern(palette.normal.left[0], palette.normal[type][0]))
+ call s:assert.match(s:hi(printf('LightLineLeft_normal_1_%s', type)), s:pattern(palette.normal.left[1], palette.normal[type][0]))
+ call s:assert.match(s:hi(printf('LightLineLeft_normal_2_%s', type)), 'E411: highlight group not found\|cleared')
+ call s:assert.match(s:hi(printf('LightLineLeft_normal_%s_0', type)), s:pattern(palette.normal[type][0], palette.normal.left[0]))
+ call s:assert.match(s:hi(printf('LightLineLeft_normal_%s_1', type)), s:pattern(palette.normal[type][0], palette.normal.left[1]))
+ call s:assert.match(s:hi(printf('LightLineLeft_normal_%s_2', type)), s:pattern(palette.normal[type][0], palette.normal.middle[0]))
+ call s:assert.match(s:hi(printf('LightLineLeft_normal_%s_3', type)), 'E411: highlight group not found\|cleared')
+ endfor
+ for type1 in ['error', 'warning']
+ for type2 in ['error', 'warning']
+ call s:assert.match(s:hi(printf('LightLineLeft_normal_%s_%s', type1, type2)), s:pattern(palette.normal[type1][0], palette.normal[type2][0]))
+ endfor
+ endfor
+endfunction
diff --git a/vim/bundle/lightline.vim/test/link.vim b/vim/bundle/lightline.vim/test/link.vim
new file mode 100644
index 0000000..ca86753
--- /dev/null
+++ b/vim/bundle/lightline.vim/test/link.vim
@@ -0,0 +1,131 @@
+let s:suite = themis#suite('link')
+let s:assert = themis#helper('assert')
+
+function! s:suite.before_each()
+ hi clear
+ let g:lightline = {}
+ call lightline#init()
+ call lightline#colorscheme()
+endfunction
+
+function! s:hi(name)
+ redir => hi
+ silent! exec 'hi' a:name
+ redir END
+ return substitute(join(split(hi, "\n"), ''), ' \+', ' ', 'g')
+endfunction
+
+function! s:suite.link()
+ call lightline#link()
+ call s:assert.match(s:hi('LightLineLeft_active_0'), 'LightLineLeft_normal_0')
+ call s:assert.match(s:hi('LightLineLeft_active_1'), 'LightLineLeft_normal_1')
+ call s:assert.match(s:hi('LightLineLeft_active_2'), 'E411: highlight group not found')
+ call s:assert.match(s:hi('LightLineRight_active_0'), 'LightLineRight_normal_0')
+ call s:assert.match(s:hi('LightLineRight_active_1'), 'LightLineRight_normal_1')
+ call s:assert.match(s:hi('LightLineRight_active_2'), 'LightLineRight_normal_2')
+ call s:assert.match(s:hi('LightLineRight_active_3'), 'E411: highlight group not found')
+ call s:assert.match(s:hi('LightLineMiddle_active'), 'LightLineMiddle_normal')
+endfunction
+
+function! s:suite.insert()
+ call lightline#link('i')
+ call s:assert.match(s:hi('LightLineLeft_active_0'), 'LightLineLeft_insert_0')
+ call s:assert.match(s:hi('LightLineLeft_active_1'), 'LightLineLeft_insert_1')
+ call s:assert.match(s:hi('LightLineLeft_active_2'), 'E411: highlight group not found')
+ call s:assert.match(s:hi('LightLineRight_active_0'), 'LightLineRight_insert_0')
+ call s:assert.match(s:hi('LightLineRight_active_1'), 'LightLineRight_insert_1')
+ call s:assert.match(s:hi('LightLineRight_active_2'), 'LightLineRight_insert_2')
+ call s:assert.match(s:hi('LightLineRight_active_3'), 'E411: highlight group not found')
+ call s:assert.match(s:hi('LightLineMiddle_active'), 'LightLineMiddle_insert')
+endfunction
+
+function! s:suite.visual()
+ call lightline#link('v')
+ call s:assert.match(s:hi('LightLineLeft_active_0'), 'LightLineLeft_visual_0')
+ call s:assert.match(s:hi('LightLineLeft_active_1'), 'LightLineLeft_visual_1')
+ call s:assert.match(s:hi('LightLineLeft_active_2'), 'E411: highlight group not found')
+ call s:assert.match(s:hi('LightLineRight_active_0'), 'LightLineRight_visual_0')
+ call s:assert.match(s:hi('LightLineRight_active_1'), 'LightLineRight_visual_1')
+ call s:assert.match(s:hi('LightLineRight_active_2'), 'LightLineRight_visual_2')
+ call s:assert.match(s:hi('LightLineRight_active_3'), 'E411: highlight group not found')
+ call s:assert.match(s:hi('LightLineMiddle_active'), 'LightLineMiddle_visual')
+endfunction
+
+function! s:suite.replace()
+ call lightline#link('R')
+ call s:assert.match(s:hi('LightLineLeft_active_0'), 'LightLineLeft_replace_0')
+ call s:assert.match(s:hi('LightLineLeft_active_1'), 'LightLineLeft_replace_1')
+ call s:assert.match(s:hi('LightLineLeft_active_2'), 'E411: highlight group not found')
+ call s:assert.match(s:hi('LightLineRight_active_0'), 'LightLineRight_replace_0')
+ call s:assert.match(s:hi('LightLineRight_active_1'), 'LightLineRight_replace_1')
+ call s:assert.match(s:hi('LightLineRight_active_2'), 'LightLineRight_replace_2')
+ call s:assert.match(s:hi('LightLineRight_active_3'), 'E411: highlight group not found')
+ call s:assert.match(s:hi('LightLineMiddle_active'), 'LightLineMiddle_replace')
+endfunction
+
+function! s:suite.left_right()
+ let g:lightline = {
+ \ 'active': {
+ \ 'left': [ [ 'mode', 'paste' ], [ 'readonly' ], [ 'filename' ], [ 'modified' ] ],
+ \ 'right': [ [ 'lineinfo' ], [ 'percent' ], [ 'fileformat' ], [ 'fileencoding' ], [ 'filetype' ] ]
+ \ },
+ \ }
+ call lightline#init()
+ call lightline#colorscheme()
+ call lightline#link()
+ call s:assert.match(s:hi('LightLineLeft_active_0'), 'LightLineLeft_normal_0')
+ call s:assert.match(s:hi('LightLineLeft_active_1'), 'LightLineLeft_normal_1')
+ call s:assert.match(s:hi('LightLineLeft_active_2'), 'LightLineLeft_normal_2')
+ call s:assert.match(s:hi('LightLineLeft_active_3'), 'LightLineLeft_normal_3')
+ call s:assert.match(s:hi('LightLineLeft_active_4'), 'E411: highlight group not found')
+ call s:assert.match(s:hi('LightLineRight_active_0'), 'LightLineRight_normal_0')
+ call s:assert.match(s:hi('LightLineRight_active_1'), 'LightLineRight_normal_1')
+ call s:assert.match(s:hi('LightLineRight_active_2'), 'LightLineRight_normal_2')
+ call s:assert.match(s:hi('LightLineRight_active_3'), 'LightLineRight_normal_3')
+ call s:assert.match(s:hi('LightLineRight_active_4'), 'LightLineRight_normal_4')
+ call s:assert.match(s:hi('LightLineRight_active_5'), 'E411: highlight group not found')
+ call s:assert.match(s:hi('LightLineMiddle_active'), 'LightLineMiddle_normal')
+endfunction
+
+function! s:suite.subseparator()
+ let g:lightline = {
+ \ 'active': {
+ \ 'left': [ [ 'mode', 'paste' ], [ 'readonly' ], [ 'filename' ], [ 'modified' ] ],
+ \ 'right': [ [ 'lineinfo' ], [ 'percent' ], [ 'fileformat' ], [ 'fileencoding' ], [ 'filetype' ] ]
+ \ },
+ \ }
+ call lightline#init()
+ call lightline#colorscheme()
+ call lightline#link()
+ for i in range(4)
+ for j in range(5)
+ if i + 1 == j
+ call s:assert.match(s:hi(printf('LightLineLeft_active_%s_%s', i, j)), printf('LightLineLeft_normal_%s_%s', i, j))
+ else
+ call s:assert.match(s:hi(printf('LightLineLeft_active_%s_%s', i, j)), 'E411: highlight group not found')
+ endif
+ endfor
+ endfor
+endfunction
+
+function! s:suite.component_type()
+ let g:lightline = { 'component_type': { 'error': 'error', 'warning': 'warning' } }
+ call lightline#init()
+ call lightline#colorscheme()
+ call lightline#link()
+ for type in ['error', 'warning']
+ call s:assert.match(s:hi(printf('LightLineLeft_active_%s', type)), printf('LightLineLeft_normal_%s', type))
+ call s:assert.match(s:hi(printf('LightLineLeft_active_0_%s', type)), printf('LightLineLeft_normal_0_%s', type))
+ call s:assert.match(s:hi(printf('LightLineLeft_active_1_%s', type)), printf('LightLineLeft_normal_1_%s', type))
+ call s:assert.match(s:hi(printf('LightLineLeft_active_2_%s', type)), 'E411: highlight group not found')
+ call s:assert.match(s:hi(printf('LightLineLeft_active_%s_0', type)), printf('LightLineLeft_normal_%s_0', type))
+ call s:assert.match(s:hi(printf('LightLineLeft_active_%s_1', type)), printf('LightLineLeft_normal_%s_1', type))
+ call s:assert.match(s:hi(printf('LightLineLeft_active_%s_2', type)), printf('LightLineLeft_normal_%s_2', type))
+ call s:assert.match(s:hi(printf('LightLineLeft_active_%s_3', type)), 'E411: highlight group not found')
+ endfor
+ for type1 in ['error', 'warning']
+ for type2 in ['error', 'warning']
+ call s:assert.match(s:hi(printf('LightLineLeft_active_%s_%s', type1, type2)), printf('LightLineLeft_normal_%s_%s', type1, type2))
+ endfor
+ endfor
+endfunction
diff --git a/vim/bundle/lightline.vim/test/mode.vim b/vim/bundle/lightline.vim/test/mode.vim
new file mode 100644
index 0000000..53280f5
--- /dev/null
+++ b/vim/bundle/lightline.vim/test/mode.vim
@@ -0,0 +1,14 @@
+let s:suite = themis#suite('mode')
+let s:assert = themis#helper('assert')
+
+function! s:suite.mode()
+ let g:lightline = {}
+ call lightline#init()
+ call s:assert.equals(lightline#mode(), 'NORMAL')
+endfunction
+
+function! s:suite.mode_map()
+ let g:lightline = { 'mode_map': { 'n': 'N' } }
+ call lightline#init()
+ call s:assert.equals(lightline#mode(), 'N')
+endfunction
diff --git a/vim/bundle/lightline.vim/test/onetab.vim b/vim/bundle/lightline.vim/test/onetab.vim
new file mode 100644
index 0000000..529d833
--- /dev/null
+++ b/vim/bundle/lightline.vim/test/onetab.vim
@@ -0,0 +1,98 @@
+let s:suite = themis#suite('onetab')
+let s:assert = themis#helper('assert')
+
+function! s:suite.before_each()
+ let g:lightline = {}
+ call lightline#init()
+ tabnew
+ tabonly
+endfunction
+
+function! s:suite.onetab()
+ call s:assert.equals(lightline#onetab(1, 1), '1 [No Name]')
+endfunction
+
+function! s:suite.tabnew()
+ tabnew
+ call s:assert.equals(lightline#onetab(1, 0), '1 [No Name]')
+ call s:assert.equals(lightline#onetab(2, 1), '2 [No Name]')
+endfunction
+
+function! s:suite.tabnew_tabnew()
+ tabnew
+ tabnew
+ call s:assert.equals(lightline#onetab(1, 0), '1 [No Name]')
+ call s:assert.equals(lightline#onetab(2, 0), '2 [No Name]')
+ call s:assert.equals(lightline#onetab(3, 1), '3 [No Name]')
+endfunction
+
+function! s:suite.modified()
+ call append(0, '')
+ call s:assert.equals(lightline#onetab(1, 1), '1 [No Name] +')
+ undo
+endfunction
+
+function! s:suite.filename()
+ edit test
+ call s:assert.equals(lightline#onetab(1, 1), '1 test')
+ tabnew
+ bunload test
+endfunction
+
+function! s:suite.filename_modified()
+ edit test
+ call append(0, '')
+ call s:assert.equals(lightline#onetab(1, 1), '1 test +')
+ tabnew
+ bunload! test
+endfunction
+
+function! s:suite.active_inactive()
+ let g:lightline = { 'tab': { 'active': [ 'tabnum', 'filename' ], 'inactive': [ 'filename' ] } }
+ call lightline#init()
+ edit test
+ call append(0, '')
+ call s:assert.equals(lightline#onetab(1, 1), '1 test')
+ call s:assert.equals(lightline#onetab(1, 0), 'test')
+ tabnew
+ bunload! test
+endfunction
+
+function! s:suite.tab_component()
+ let g:lightline = { 'tab': { 'active': [ 'custom' ] }, 'tab_component': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(lightline#onetab(1, 1), 'custom')
+ call s:assert.equals(lightline#onetab(2, 1), 'custom')
+endfunction
+
+function! s:suite.tab_component_function()
+ function! Custom(n)
+ return 'custom: ' . a:n
+ endfunction
+ let g:lightline = { 'tab': { 'active': [ 'custom' ] }, 'tab_component_function': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(lightline#onetab(1, 1), 'custom: 1')
+ call s:assert.equals(lightline#onetab(2, 1), 'custom: 2')
+ delfunction Custom
+endfunction
+
+function! s:suite.tab_component_empty_middle()
+ let g:lightline = { 'tab': { 'active': [ 'tabnum', 'custom', 'filename' ], 'inactive': [ 'tabnum', 'custom', 'custom', 'filename' ] }, 'tab_component': { 'custom': '' } }
+ call lightline#init()
+ call s:assert.equals(lightline#onetab(1, 1), '1 [No Name]')
+ call s:assert.equals(lightline#onetab(2, 1), '2 [No Name]')
+endfunction
+
+function! s:suite.tab_component_empty_left()
+ let g:lightline = { 'tab': { 'active': [ 'custom', 'filename' ], 'inactive': [ 'custom', 'custom', 'filename' ] }, 'tab_component': { 'custom': '' } }
+ call lightline#init()
+ call s:assert.equals(lightline#onetab(1, 1), '[No Name]')
+ call s:assert.equals(lightline#onetab(2, 1), '[No Name]')
+endfunction
+
+function! s:suite.tab_component_empty_middle()
+ let g:lightline = { 'tab': { 'active': [ 'tabnum', 'custom' ], 'inactive': [ 'tabnum', 'custom', 'custom' ] }, 'tab_component': { 'custom': '' } }
+ call lightline#init()
+ call s:assert.equals(lightline#onetab(1, 1), '1')
+ call s:assert.equals(lightline#onetab(2, 1), '2')
+endfunction
diff --git a/vim/bundle/lightline.vim/test/subseparator.vim b/vim/bundle/lightline.vim/test/subseparator.vim
new file mode 100644
index 0000000..02cac4c
--- /dev/null
+++ b/vim/bundle/lightline.vim/test/subseparator.vim
@@ -0,0 +1,302 @@
+let s:suite = themis#suite('subseparator')
+let s:assert = themis#helper('assert')
+
+function! s:subseparator(...)
+ return eval(substitute(call(SID('subseparator'), a:000), '^%{\|}$', '', 'g'))
+endfunction
+
+function! s:suite.subseparator_component()
+ let g:lightline = { 'component': { 'custom1': 'custom1', 'custom2': 'custom2', 'custom3': 'custom3' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|')
+endfunction
+
+function! s:suite.subseparator_component_visible_condition_1()
+ let g:lightline = { 'component': { 'custom1': 'custom1', 'custom2': 'custom2', 'custom3': 'custom3' }, 'component_visible_condition': { 'custom1': '1', 'custom2': '1', 'custom3': '1' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|')
+endfunction
+
+function! s:suite.subseparator_component_visible_condition_2()
+ let g:lightline = { 'component': { 'custom1': 'custom1', 'custom2': 'custom2', 'custom3': 'custom3' }, 'component_visible_condition': { 'custom1': '0', 'custom2': '1', 'custom3': '1' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
+endfunction
+
+function! s:suite.subseparator_component_visible_condition_3()
+ let g:lightline = { 'component': { 'custom1': 'custom1', 'custom2': 'custom2', 'custom3': 'custom3' }, 'component_visible_condition': { 'custom1': '1', 'custom2': '0', 'custom3': '1' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|')
+endfunction
+
+function! s:suite.subseparator_component_visible_condition_4()
+ let g:lightline = { 'component': { 'custom1': 'custom1', 'custom2': 'custom2', 'custom3': 'custom3' }, 'component_visible_condition': { 'custom1': '1', 'custom2': '0', 'custom3': '0' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
+endfunction
+
+function! s:suite.subseparator_component_visible_condition_5()
+ let g:lightline = { 'component': { 'custom1': 'custom1', 'custom2': 'custom2', 'custom3': 'custom3' }, 'component_visible_condition': { 'custom1': '0', 'custom2': '0', 'custom3': '0' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
+endfunction
+
+function! s:suite.subseparator_component_visible_condition_6()
+ let g:lightline = { 'component': { 'custom1': 'custom1', 'custom2': 'custom2', 'custom3': 'custom3' }, 'component_visible_condition': { 'custom1': '1||0', 'custom2': '0', 'custom3': '0' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
+endfunction
+
+function! s:suite.subseparator_component_visible_condition_7()
+ let g:lightline = { 'component': { 'custom1': 'custom1', 'custom2': 'custom2', 'custom3': 'custom3' }, 'component_visible_condition': { 'custom1': '1||1', 'custom2': '0', 'custom3': '0' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
+endfunction
+
+function! s:suite.subseparator_component_function()
+ function! Custom1()
+ return 'custom1'
+ endfunction
+ function! Custom2()
+ return 'custom2'
+ endfunction
+ function! Custom3()
+ return 'custom3'
+ endfunction
+ let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|')
+ delfunction Custom1
+ delfunction Custom2
+ delfunction Custom3
+endfunction
+
+function! s:suite.subseparator_component_function_1()
+ function! Custom1()
+ return 'custom1'
+ endfunction
+ let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
+ delfunction Custom1
+endfunction
+
+function! s:suite.subseparator_component_function_2()
+ function! Custom1()
+ return 'custom1'
+ endfunction
+ function! Custom2()
+ return 'custom2'
+ endfunction
+ let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|')
+ delfunction Custom1
+ delfunction Custom2
+endfunction
+
+function! s:suite.subseparator_component_function_3()
+ function! Custom1()
+ return 'custom1'
+ endfunction
+ function! Custom3()
+ return 'custom3'
+ endfunction
+ let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|')
+ delfunction Custom1
+ delfunction Custom3
+endfunction
+
+function! s:suite.subseparator_component_function_4()
+ function! Custom2()
+ return 'custom2'
+ endfunction
+ function! Custom3()
+ return 'custom3'
+ endfunction
+ let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
+ delfunction Custom2
+ delfunction Custom3
+endfunction
+
+function! s:suite.subseparator_component_function_5()
+ function! Custom1()
+ return ''
+ endfunction
+ function! Custom2()
+ return 'custom2'
+ endfunction
+ function! Custom3()
+ return 'custom3'
+ endfunction
+ let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
+ delfunction Custom1
+ delfunction Custom2
+ delfunction Custom3
+endfunction
+
+function! s:suite.subseparator_component_function_6()
+ function! Custom1()
+ return ''
+ endfunction
+ function! Custom2()
+ return ''
+ endfunction
+ function! Custom3()
+ return 'custom3'
+ endfunction
+ let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
+ delfunction Custom1
+ delfunction Custom2
+ delfunction Custom3
+endfunction
+
+function! s:suite.subseparator_component_function_7()
+ function! Custom1()
+ return 'custom1'
+ endfunction
+ function! Custom2()
+ return ''
+ endfunction
+ function! Custom3()
+ return ''
+ endfunction
+ let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
+ delfunction Custom1
+ delfunction Custom2
+ delfunction Custom3
+endfunction
+
+function! s:suite.subseparator_component_expand()
+ function! Custom1()
+ return 'custom1'
+ endfunction
+ function! Custom2()
+ return 'custom2'
+ endfunction
+ function! Custom3()
+ return 'custom3'
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [1, 1, 1]), '|')
+ delfunction Custom1
+ delfunction Custom2
+ delfunction Custom3
+endfunction
+
+function! s:suite.subseparator_component_expand()
+ function! Custom1()
+ return 'custom1'
+ endfunction
+ function! Custom2()
+ return 'custom2'
+ endfunction
+ function! Custom3()
+ return 'custom3'
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [1, 1, 1]), '|')
+ delfunction Custom1
+ delfunction Custom2
+ delfunction Custom3
+endfunction
+
+function! s:suite.subseparator_component_expand_1()
+ function! Custom1()
+ return 'custom1'
+ endfunction
+ function! Custom2()
+ return 'custom2'
+ endfunction
+ function! Custom3()
+ return 'custom3'
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom1': 'Custom1' }, 'component_function': { 'custom2': 'Custom2', 'custom3': 'Custom3' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [1, 0, 0]), '|')
+ delfunction Custom1
+ delfunction Custom2
+ delfunction Custom3
+endfunction
+
+function! s:suite.subseparator_component_expand_2()
+ function! Custom1()
+ return 'custom1'
+ endfunction
+ function! Custom2()
+ return 'custom2'
+ endfunction
+ function! Custom3()
+ return 'custom3'
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom1': 'Custom1', 'custom2': 'Custom2' }, 'component_function': { 'custom3': 'Custom3' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [1, 1, 0]), '|')
+ delfunction Custom1
+ delfunction Custom2
+ delfunction Custom3
+endfunction
+
+function! s:suite.subseparator_component_expand_3()
+ function! Custom1()
+ return ''
+ endfunction
+ function! Custom2()
+ return 'custom2'
+ endfunction
+ function! Custom3()
+ return 'custom3'
+ endfunction
+ let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2' }, 'component_expand': { 'custom3': 'Custom3' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 1]), '')
+ delfunction Custom1
+ delfunction Custom2
+ delfunction Custom3
+endfunction
+
+function! s:suite.subseparator_component_not_found()
+ function! Custom1()
+ return 'custom1'
+ endfunction
+ let g:lightline = { 'component_function': { 'custom1': 'Custom1' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
+ delfunction Custom1
+endfunction
+
+function! s:suite.subseparator_component_not_found_1()
+ function! Custom2()
+ return 'custom2'
+ endfunction
+ let g:lightline = { 'component_function': { 'custom2': 'Custom2' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
+ delfunction Custom2
+endfunction
+
+function! s:suite.subseparator_component_not_found_2()
+ function! Custom1()
+ return 'custom1'
+ endfunction
+ function! Custom2()
+ return 'custom2'
+ endfunction
+ let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|')
+ delfunction Custom1
+ delfunction Custom2
+endfunction
diff --git a/vim/bundle/lightline.vim/test/tabline.vim b/vim/bundle/lightline.vim/test/tabline.vim
new file mode 100644
index 0000000..0a9879f
--- /dev/null
+++ b/vim/bundle/lightline.vim/test/tabline.vim
@@ -0,0 +1,67 @@
+let s:suite = themis#suite('tabline')
+let s:assert = themis#helper('assert')
+
+function! s:suite.before_each()
+ let g:lightline = {}
+ call lightline#init()
+ tabnew
+ tabonly
+endfunction
+
+function! s:suite.tabline()
+ call s:assert.equals(&tabline, '%!lightline#tabline()')
+endfunction
+
+function! s:suite.enabled()
+ let g:lightline = { 'enable': { 'tabline': 1 } }
+ call lightline#init()
+ call s:assert.equals(&tabline, '%!lightline#tabline()')
+endfunction
+
+function! s:suite.disabled()
+ let g:lightline = { 'enable': { 'tabline': 0 } }
+ call lightline#init()
+ call s:assert.equals(&tabline, '')
+endfunction
+
+function! s:suite.tabnew()
+ let tabline = lightline#tabline()
+ tabnew
+ call s:assert.not_equals(lightline#tabline(), tabline)
+endfunction
+
+function! s:suite.tabnew_first()
+ let tabline = lightline#tabline()
+ 0tabnew
+ call s:assert.not_equals(lightline#tabline(), tabline)
+endfunction
+
+function! s:suite.tabnext()
+ tabnew
+ let tabline = lightline#tabline()
+ tabnext
+ call s:assert.not_equals(lightline#tabline(), tabline)
+endfunction
+
+function! s:suite.tabonly()
+ tabnew
+ tabfirst
+ let tabline = lightline#tabline()
+ tabonly
+ call s:assert.not_equals(lightline#tabline(), tabline)
+endfunction
+
+function! s:suite.tabclose()
+ tabnew
+ let tabline = lightline#tabline()
+ tabclose
+ call s:assert.not_equals(lightline#tabline(), tabline)
+endfunction
+
+function! s:suite.tabclose_last()
+ tabnew
+ tabfirst
+ let tabline = lightline#tabline()
+ $tabclose
+ call s:assert.not_equals(lightline#tabline(), tabline)
+endfunction
diff --git a/vim/bundle/lightline.vim/test/tabs.vim b/vim/bundle/lightline.vim/test/tabs.vim
new file mode 100644
index 0000000..92c2c08
--- /dev/null
+++ b/vim/bundle/lightline.vim/test/tabs.vim
@@ -0,0 +1,99 @@
+let s:suite = themis#suite('tabs')
+let s:assert = themis#helper('assert')
+
+function! s:suite.before_each()
+ let g:lightline = { 'winwidth': 180 }
+ call lightline#init()
+ tabnew
+ tabonly
+endfunction
+
+function! s:tab(number, ...) abort
+ let active = get(a:000, 0, 0)
+ let last = get(a:000, 1, 0)
+ return '%' . a:number . 'T%{lightline#onetab(' . a:number . ',' . active . ')}' . (last ? '%T' : '')
+endfunction
+
+function! s:suite.tabs()
+ call s:assert.equals(lightline#tabs(), [[], [s:tab(1, 1, 1)], []])
+endfunction
+
+function! s:suite.tabnew()
+ tabnew
+ call s:assert.equals(lightline#tabs(), [[s:tab(1)], [s:tab(2, 1, 1)], []])
+endfunction
+
+function! s:suite.tabnew_tabnew()
+ tabnew
+ tabnew
+ call s:assert.equals(lightline#tabs(), [[s:tab(1), s:tab(2)], [s:tab(3, 1, 1)], []])
+endfunction
+
+function! s:suite.tabnew_tabfirst()
+ tabnew
+ tabfirst
+ call s:assert.equals(lightline#tabs(), [[], [s:tab(1, 1)], [s:tab(2, 0, 1)]])
+endfunction
+
+function! s:suite.tabnew_tabnew_tabfirst()
+ tabnew
+ tabnew
+ tabfirst
+ call s:assert.equals(lightline#tabs(), [[], [s:tab(1, 1)], [s:tab(2), s:tab(3, 0, 1)]])
+endfunction
+
+function! s:suite.tabnew_tabnew_tabprevious()
+ tabnew
+ tabnew
+ tabprevious
+ call s:assert.equals(lightline#tabs(), [[s:tab(1)], [s:tab(2, 1)], [s:tab(3, 0, 1)]])
+endfunction
+
+function! s:suite.tabnew_20()
+ for i in range(19)
+ tabnew
+ endfor
+ call s:assert.equals(lightline#tabs(), [[s:tab(1), s:tab(2), s:tab(3), s:tab(4), '...', s:tab(16), s:tab(17), s:tab(18), s:tab(19)], [s:tab(20, 1, 1)], []])
+endfunction
+
+function! s:suite.tabnew_20_tabfirst()
+ for i in range(19)
+ tabnew
+ endfor
+ tabfirst
+ call s:assert.equals(lightline#tabs(), [[], [s:tab(1, 1)], [s:tab(2), s:tab(3), s:tab(4), s:tab(5), '...', s:tab(17), s:tab(18), s:tab(19), s:tab(20, 0, 1)]])
+endfunction
+
+function! s:suite.tabnew_20_tabfirst_tabnext()
+ for i in range(19)
+ tabnew
+ endfor
+ tabfirst
+ tabnext
+ call s:assert.equals(lightline#tabs(), [[s:tab(1)], [s:tab(2, 1)], [s:tab(3), s:tab(4), s:tab(5), s:tab(6), '...', s:tab(18), s:tab(19), s:tab(20, 0, 1)]])
+endfunction
+
+function! s:suite.tabnew_20_tabnext_10()
+ for i in range(19)
+ tabnew
+ endfor
+ tabnext 10
+ call s:assert.equals(lightline#tabs(), [[s:tab(1), s:tab(2), '...', s:tab(8), s:tab(9)], [s:tab(10, 1)], [s:tab(11), s:tab(12), '...', s:tab(19), s:tab(20, 0, 1)]])
+endfunction
+
+function! s:suite.tabnew_20_tabprevious()
+ for i in range(19)
+ tabnew
+ endfor
+ tabprevious
+ call s:assert.equals(lightline#tabs(), [[s:tab(1), s:tab(2), s:tab(3), '...', s:tab(15), s:tab(16), s:tab(17), s:tab(18)], [s:tab(19, 1)], [s:tab(20, 0, 1)]])
+endfunction
+
+function! s:suite.tabnew_20_tabprevious_tabprevious()
+ for i in range(19)
+ tabnew
+ endfor
+ tabprevious
+ tabprevious
+ call s:assert.equals(lightline#tabs(), [[s:tab(1), s:tab(2), s:tab(3), '...', s:tab(15), s:tab(16), s:tab(17)], [s:tab(18, 1)], [s:tab(19), s:tab(20, 0, 1)]])
+endfunction
diff --git a/vim/bundle/lightline.vim/test/toggle.vim b/vim/bundle/lightline.vim/test/toggle.vim
new file mode 100644
index 0000000..c6042a8
--- /dev/null
+++ b/vim/bundle/lightline.vim/test/toggle.vim
@@ -0,0 +1,37 @@
+let s:suite = themis#suite('toggle')
+let s:assert = themis#helper('assert')
+
+function! s:suite.before_each()
+ let g:lightline = {}
+ call lightline#init()
+ tabnew
+ tabonly
+endfunction
+
+function! s:suite.default()
+ call s:assert.equals(exists('#lightline'), 1)
+ call s:assert.equals(exists('#lightline-disable'), 0)
+ call s:assert.not_equals(&tabline, '')
+endfunction
+
+function! s:suite.disable_enable()
+ call lightline#disable()
+ call s:assert.equals(exists('#lightline'), 0)
+ call s:assert.equals(exists('#lightline-disable'), 1)
+ call s:assert.equals(&tabline, '')
+ call lightline#enable()
+ call s:assert.equals(exists('#lightline'), 1)
+ call s:assert.equals(exists('#lightline-disable'), 0)
+ call s:assert.not_equals(&tabline, '')
+endfunction
+
+function! s:suite.toggle()
+ call lightline#toggle()
+ call s:assert.equals(exists('#lightline'), 0)
+ call s:assert.equals(exists('#lightline-disable'), 1)
+ call s:assert.equals(&tabline, '')
+ call lightline#toggle()
+ call s:assert.equals(exists('#lightline'), 1)
+ call s:assert.equals(exists('#lightline-disable'), 0)
+ call s:assert.not_equals(&tabline, '')
+endfunction
diff --git a/vim/bundle/lightline.vim/test/uniq.vim b/vim/bundle/lightline.vim/test/uniq.vim
new file mode 100644
index 0000000..cdfaec0
--- /dev/null
+++ b/vim/bundle/lightline.vim/test/uniq.vim
@@ -0,0 +1,46 @@
+let s:suite = themis#suite('uniq')
+let s:assert = themis#helper('assert')
+
+function! s:uniq(...)
+ try
+ return call(SID('uniq'), a:000)
+ catch
+ return call(function('uniq'), a:000)
+ endtry
+endfunction
+
+function! s:suite.nil()
+ call s:assert.equals(s:uniq([]), [])
+endfunction
+
+function! s:suite.one()
+ call s:assert.equals(s:uniq(['foo']), ['foo'])
+endfunction
+
+function! s:suite.two()
+ call s:assert.equals(s:uniq(['foo', 'bar']), ['foo', 'bar'])
+endfunction
+
+function! s:suite.three()
+ call s:assert.equals(s:uniq(['foo', 'bar', 'baz']), ['foo', 'bar', 'baz'])
+endfunction
+
+function! s:suite.two_duplicated()
+ call s:assert.equals(s:uniq(['foo', 'foo']), ['foo'])
+endfunction
+
+function! s:suite.three_duplicated()
+ call s:assert.equals(s:uniq(['foo', 'bar', 'foo']), ['foo', 'bar', 'foo'])
+endfunction
+
+function! s:suite.many1()
+ call s:assert.equals(s:uniq(['foo', 'foo', 'bar', 'baz', 'baz', 'qux', 'foo']), ['foo', 'bar', 'baz', 'qux', 'foo'])
+endfunction
+
+function! s:suite.many2()
+ call s:assert.equals(s:uniq(['foo', 'foo', 'foo', 'foo', 'bar', 'bar', 'bar']), ['foo', 'bar'])
+endfunction
+
+function! s:suite.many3()
+ call s:assert.equals(s:uniq(['foo', 'foo', 'bar', 'bar', 'bar', 'foo', 'foo', 'foo']), ['foo', 'bar', 'foo'])
+endfunction