diff --git a/test/expand.vim b/test/expand.vim index 37804ee..b8e5843 100644 --- a/test/expand.vim +++ b/test/expand.vim @@ -45,6 +45,19 @@ function! s:suite.custom_type() delfunction Custom endfunction +function! s:suite.raw_type() + function! Custom() + return [ ['left'], ['middle'], ['right'] ] + endfunction + let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'raw' } } + call lightline#init() + call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]), + \ [[['readonly', 'filename'], ['left', 'middle', 'right'], ['modified']], [[0, 0], [2, 2, 2], [0]], ['0', '1', '2', '3']]) + call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]), + \ [[['readonly', 'filename', 'left', 'middle', 'right', 'modified']], [[0, 0, 2, 2, 2, 0]], ['0', '1']]) + delfunction Custom +endfunction + function! s:suite.multiple() function! Custom() return [ ['x0', 'x1', 'x2'], ['y0', 'y1', 'y2'], ['z0', 'z1', 'z2'] ]