mirror of
https://github.com/itchyny/lightline.vim.git
synced 2025-11-14 14:33:51 -05:00
add more tests, the function returns void string, for s:expand
This commit is contained in:
@@ -67,6 +67,32 @@ function! s:suite.custom_type_string()
|
|||||||
delfunction Custom
|
delfunction Custom
|
||||||
endfunction
|
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(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]),
|
||||||
|
\ [[['readonly', 'filename'], [], ['modified']], [[0, 0], [], [0]], [0, 1, 2, 3]])
|
||||||
|
call s:assert.equals(SID('expand')([['readonly', 'filename', 'custom', 'modified']]),
|
||||||
|
\ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], [0, 1]])
|
||||||
|
delfunction Custom
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:suite.custom_void_string()
|
||||||
|
function! Custom()
|
||||||
|
return ''
|
||||||
|
endfunction
|
||||||
|
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
|
||||||
|
call lightline#init()
|
||||||
|
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]),
|
||||||
|
\ [[['readonly', 'filename'], ['modified']], [[0, 0], [0]], [0, 2, 3]])
|
||||||
|
call s:assert.equals(SID('expand')([['readonly', 'filename', 'custom', 'modified']]),
|
||||||
|
\ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], [0, 1]])
|
||||||
|
delfunction Custom
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! s:suite.custom_number()
|
function! s:suite.custom_number()
|
||||||
function! Custom()
|
function! Custom()
|
||||||
return 24
|
return 24
|
||||||
|
|||||||
Reference in New Issue
Block a user