mirror of
https://github.com/itchyny/lightline.vim.git
synced 2025-11-12 21:43:50 -05:00
add more tests for s:expand: arrays of arrays
This commit is contained in:
@@ -17,7 +17,7 @@ endfunction
|
|||||||
|
|
||||||
function! s:suite.custom()
|
function! s:suite.custom()
|
||||||
function! Custom()
|
function! Custom()
|
||||||
return [ 'left', 'middle', 'right' ]
|
return [ ['left'], ['middle'], ['right'] ]
|
||||||
endfunction
|
endfunction
|
||||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
|
let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
|
||||||
call lightline#init()
|
call lightline#init()
|
||||||
@@ -29,6 +29,32 @@ function! s:suite.custom()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:suite.custom_type()
|
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(SID('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(SID('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.flatten()
|
||||||
|
function! Custom()
|
||||||
|
return [ 'left', 'middle', 'right' ]
|
||||||
|
endfunction
|
||||||
|
let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
|
||||||
|
call lightline#init()
|
||||||
|
call s:assert.equals(SID('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(SID('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()
|
function! Custom()
|
||||||
return [ 'left', 'middle', 'right' ]
|
return [ 'left', 'middle', 'right' ]
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
Reference in New Issue
Block a user