mirror of
https://github.com/amix/vimrc
synced 2025-08-04 04:05:00 +08:00
Updated plugins
This commit is contained in:
@ -156,7 +156,7 @@ function! s:suite.custom_void_string()
|
||||
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']])
|
||||
\ [[['readonly', 'filename'], [], ['modified']], [[0, 0], [], [0]], ['0', '1', '2', '3']])
|
||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
||||
\ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
|
||||
delfunction Custom
|
||||
@ -169,7 +169,7 @@ function! s:suite.custom_type_void_string()
|
||||
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']])
|
||||
\ [[['readonly', 'filename'], [], ['modified']], [[0, 0], [], [0]], ['0', '1', '2', '3']])
|
||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
||||
\ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
|
||||
delfunction Custom
|
||||
@ -208,7 +208,7 @@ function! s:suite.custom_void_string_array()
|
||||
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']])
|
||||
\ [[['readonly', 'filename'], [], ['modified']], [[0, 0], [], [0]], ['0', '1', '2', '3']])
|
||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
||||
\ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
|
||||
delfunction Custom
|
||||
@ -221,7 +221,7 @@ function! s:suite.custom_type_void_string_array()
|
||||
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']])
|
||||
\ [[['readonly', 'filename'], [], ['modified']], [[0, 0], [], [0]], ['0', '1', '2', '3']])
|
||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
||||
\ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
|
||||
delfunction Custom
|
||||
@ -234,7 +234,7 @@ function! s:suite.custom_void_string_array_2()
|
||||
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']])
|
||||
\ [[['readonly', 'filename'], [], ['modified']], [[0, 0], [], [0]], ['0', '1', '2', '3']])
|
||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
||||
\ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
|
||||
delfunction Custom
|
||||
@ -247,7 +247,7 @@ function! s:suite.custom_type_void_string_array_2()
|
||||
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']])
|
||||
\ [[['readonly', 'filename'], [], ['modified']], [[0, 0], [], [0]], ['0', '1', '2', '3']])
|
||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
||||
\ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
|
||||
delfunction Custom
|
||||
@ -469,7 +469,7 @@ function! s:suite.custom_error()
|
||||
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']])
|
||||
\ [[['readonly', 'filename'], [], ['modified']], [[0, 0], [], [0]], ['0', '1', '2', '3']])
|
||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
||||
\ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
|
||||
delfunction Custom
|
||||
@ -483,7 +483,7 @@ function! s:suite.custom_type_error()
|
||||
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']])
|
||||
\ [[['readonly', 'filename'], [], ['modified']], [[0, 0], [], [0]], ['0', '1', '2', '3']])
|
||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
||||
\ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
|
||||
delfunction Custom
|
||||
@ -493,7 +493,7 @@ 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']])
|
||||
\ [[['readonly', 'filename'], [], ['modified']], [[0, 0], [], [0]], ['0', '1', '2', '3']])
|
||||
call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
|
||||
\ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
|
||||
endfunction
|
||||
@ -502,11 +502,28 @@ 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']])
|
||||
\ [[['readonly', 'filename'], [], ['modified']], [[0, 0], [], [0]], ['0', '1', '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_string()
|
||||
function! Custom()
|
||||
return 'custom'
|
||||
endfunction
|
||||
function! Modified()
|
||||
return ''
|
||||
endfunction
|
||||
let g:lightline = { 'component_expand': { 'custom': 'Custom', 'modified': 'Modified' } }
|
||||
call lightline#init()
|
||||
call s:assert.equals(s:expand([['filename'], ['custom', 'custom'], ['modified']]),
|
||||
\ [[['filename'], ['custom', 'custom'], []], [[0], [1, 1], []], ['0', '1', '2', '3']])
|
||||
call s:assert.equals(s:expand([['filename', 'custom', 'custom', 'modified']]),
|
||||
\ [[['filename', 'custom', 'custom']], [[0, 1, 1]], ['0', '1']])
|
||||
delfunction Custom
|
||||
delfunction Modified
|
||||
endfunction
|
||||
|
||||
function! s:suite.duplicated_left_nil()
|
||||
function! Custom()
|
||||
return [ [], ['y0', 'y1'], ['z0', 'z1'] ]
|
||||
|
@ -2,12 +2,24 @@ let s:suite = themis#suite('link')
|
||||
let s:assert = themis#helper('assert')
|
||||
|
||||
function! s:suite.before_each()
|
||||
hi clear
|
||||
call s:clear()
|
||||
let g:lightline = {}
|
||||
call lightline#init()
|
||||
call lightline#colorscheme()
|
||||
endfunction
|
||||
|
||||
function! s:clear()
|
||||
hi clear
|
||||
redir => hi
|
||||
silent! hi
|
||||
redir END
|
||||
for line in split(hi, '\n')
|
||||
if match(line, 'links to') > 0
|
||||
exec 'hi link' matchstr(line, '^\S*') 'NONE'
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
function! s:hi(name)
|
||||
redir => hi
|
||||
silent! exec 'hi' a:name
|
||||
@ -19,11 +31,11 @@ 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('LightlineLeft_active_2'), 'E411: highlight group not found\|cleared')
|
||||
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('LightlineRight_active_3'), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi('LightlineMiddle_active'), 'LightlineMiddle_normal')
|
||||
endfunction
|
||||
|
||||
@ -31,11 +43,11 @@ 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('LightlineLeft_active_2'), 'E411: highlight group not found\|cleared')
|
||||
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('LightlineRight_active_3'), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi('LightlineMiddle_active'), 'LightlineMiddle_insert')
|
||||
endfunction
|
||||
|
||||
@ -43,11 +55,11 @@ 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('LightlineLeft_active_2'), 'E411: highlight group not found\|cleared')
|
||||
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('LightlineRight_active_3'), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi('LightlineMiddle_active'), 'LightlineMiddle_visual')
|
||||
endfunction
|
||||
|
||||
@ -55,11 +67,11 @@ 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('LightlineLeft_active_2'), 'E411: highlight group not found\|cleared')
|
||||
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('LightlineRight_active_3'), 'E411: highlight group not found\|cleared')
|
||||
call s:assert.match(s:hi('LightlineMiddle_active'), 'LightlineMiddle_replace')
|
||||
endfunction
|
||||
|
||||
|
Reference in New Issue
Block a user