mirror of
https://github.com/itchyny/lightline.vim.git
synced 2025-11-15 15:03:51 -05:00
add more tests for void string in s:expand
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
" Filename: autoload/lightline.vim
|
||||
" Author: itchyny
|
||||
" License: MIT License
|
||||
" Last Change: 2016/03/21 16:05:22.
|
||||
" Last Change: 2016/03/21 16:28:31.
|
||||
" =============================================================================
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
|
||||
@@ -119,6 +119,58 @@ function! s:suite.custom_type_number()
|
||||
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(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_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(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_void_string_array_2()
|
||||
function! Custom()
|
||||
return ['', 'custom', '']
|
||||
endfunction
|
||||
let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
|
||||
call lightline#init()
|
||||
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]),
|
||||
\ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], [0, 1, 2, 3]])
|
||||
call s:assert.equals(SID('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_2()
|
||||
function! Custom()
|
||||
return ['', 'custom', '']
|
||||
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'], ['custom'], ['modified']], [[0, 0], [1], [0]], [0, 'custom', 2, 3]])
|
||||
call s:assert.equals(SID('expand')([['readonly', 'filename', 'custom', 'modified']]),
|
||||
\ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], [0, 'custom', 0, 1]])
|
||||
delfunction Custom
|
||||
endfunction
|
||||
|
||||
function! s:suite.custom_mixed()
|
||||
function! Custom()
|
||||
return ['left', { 'custom': 24 }, [function('tr')]]
|
||||
|
||||
Reference in New Issue
Block a user