improve tests for s:expand

This commit is contained in:
itchyny
2016-03-22 08:58:29 +09:00
parent 5f50a0d0fa
commit ba4e7552ec

View File

@@ -1,17 +1,21 @@
let s:suite = themis#suite('expand') let s:suite = themis#suite('expand')
let s:assert = themis#helper('assert') let s:assert = themis#helper('assert')
function! s:expand(...)
return call(SID('expand'), a:000)
endfunction
function! s:suite.expand() function! s:suite.expand()
let g:lightline = {} let g:lightline = {}
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([]), call s:assert.equals(s:expand([]),
\ [[], [], [0]]) \ [[], [], [0]])
endfunction endfunction
function! s:suite.default() function! s:suite.default()
let g:lightline = {} let g:lightline = {}
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['mode', 'paste'], ['readonly', 'filename', 'modified']]), call s:assert.equals(s:expand([['mode', 'paste'], ['readonly', 'filename', 'modified']]),
\ [[['mode', 'paste'], ['readonly', 'filename', 'modified']], [[0, 0], [0, 0, 0]], [0, 1, 2]]) \ [[['mode', 'paste'], ['readonly', 'filename', 'modified']], [[0, 0], [0, 0, 0]], [0, 1, 2]])
endfunction endfunction
@@ -21,9 +25,9 @@ function! s:suite.custom()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
\ [[['readonly', 'filename'], ['left', 'middle', 'right'], ['modified']], [[0, 0], [1, 1, 1], [0]], [0, 1, 2, 3]]) \ [[['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']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename', 'left', 'middle', 'right', 'modified']], [[0, 0, 1, 1, 1, 0]], [0, 1]]) \ [[['readonly', 'filename', 'left', 'middle', 'right', 'modified']], [[0, 0, 1, 1, 1, 0]], [0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -34,9 +38,9 @@ function! s:suite.custom_type()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
\ [[['readonly', 'filename'], ['left'], ['middle'], ['right'], ['modified']], [[0, 0], [1], [1], [1], [0]], [0, 1, 'custom', 1, 2, 3]]) \ [[['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']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename', 'left'], ['middle'], ['right', 'modified']], [[0, 0, 1], [1], [1, 0]], [0, 'custom', 0, 1]]) \ [[['readonly', 'filename', 'left'], ['middle'], ['right', 'modified']], [[0, 0, 1], [1], [1, 0]], [0, 'custom', 0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -47,9 +51,9 @@ function! s:suite.multiple()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
\ [[['readonly', 'filename'], ['x0', 'x1', 'x2', 'y0', 'y1', 'y2', 'z0', 'z1', 'z2'], ['modified']], [[0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1], [0]], [0, 1, 2, 3]]) \ [[['readonly', 'filename'], ['x0', 'x1', 'x2', 'y0', 'y1', 'y2', 'z0', 'z1', 'z2'], ['modified']], [[0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1], [0]], [0, 1, 2, 3]])
call s:assert.equals(SID('expand')([['readonly', 'filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename', 'x0', 'x1', 'x2', 'y0', 'y1', 'y2', 'z0', 'z1', 'z2', 'modified']], [[0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0]], [0, 1]]) \ [[['readonly', 'filename', 'x0', 'x1', 'x2', 'y0', 'y1', 'y2', 'z0', 'z1', 'z2', 'modified']], [[0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0]], [0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -60,9 +64,9 @@ function! s:suite.multiple_type()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
\ [[['readonly', 'filename'], ['x0', 'x1', 'x2'], ['y0', 'y1', 'y2'], ['z0', 'z1', 'z2'], ['modified']], [[0, 0], [1, 1, 1], [1, 1, 1], [1, 1, 1], [0]], [0, 1, 'custom', 1, 2, 3]]) \ [[['readonly', 'filename'], ['x0', 'x1', 'x2'], ['y0', 'y1', 'y2'], ['z0', 'z1', 'z2'], ['modified']], [[0, 0], [1, 1, 1], [1, 1, 1], [1, 1, 1], [0]], [0, 1, 'custom', 1, 2, 3]])
call s:assert.equals(SID('expand')([['readonly', 'filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename', 'x0', 'x1', 'x2'], ['y0', 'y1', 'y2'], ['z0', 'z1', 'z2', 'modified']], [[0, 0, 1, 1, 1], [1, 1, 1], [1, 1, 1, 0]], [0, 'custom', 0, 1]]) \ [[['readonly', 'filename', 'x0', 'x1', 'x2'], ['y0', 'y1', 'y2'], ['z0', 'z1', 'z2', 'modified']], [[0, 0, 1, 1, 1], [1, 1, 1], [1, 1, 1, 0]], [0, 'custom', 0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -73,9 +77,9 @@ function! s:suite.flatten()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
\ [[['readonly', 'filename'], ['left', 'middle', 'right'], ['modified']], [[0, 0], [1, 1, 1], [0]], [0, 1, 2, 3]]) \ [[['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']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename', 'left', 'middle', 'right', 'modified']], [[0, 0, 1, 1, 1, 0]], [0, 1]]) \ [[['readonly', 'filename', 'left', 'middle', 'right', 'modified']], [[0, 0, 1, 1, 1, 0]], [0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -86,9 +90,9 @@ function! s:suite.custom_type_flatten()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
\ [[['readonly', 'filename'], ['left'], ['middle'], ['right'], ['modified']], [[0, 0], [1], [1], [1], [0]], [0, 1, 'custom', 1, 2, 3]]) \ [[['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']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename', 'left'], ['middle'], ['right', 'modified']], [[0, 0, 1], [1], [1, 0]], [0, 'custom', 0, 1]]) \ [[['readonly', 'filename', 'left'], ['middle'], ['right', 'modified']], [[0, 0, 1], [1], [1, 0]], [0, 'custom', 0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -99,9 +103,9 @@ function! s:suite.custom_string()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
\ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], [0, 1, 2, 3]]) \ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], [0, 1, 2, 3]])
call s:assert.equals(SID('expand')([['readonly', 'filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename', 'custom', 'modified']], [[0, 0, 1, 0]], [0, 1]]) \ [[['readonly', 'filename', 'custom', 'modified']], [[0, 0, 1, 0]], [0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -112,9 +116,9 @@ function! s:suite.custom_type_string()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
\ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], [0, 'custom', 2, 3]]) \ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], [0, 'custom', 2, 3]])
call s:assert.equals(SID('expand')([['readonly', 'filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], [0, 'custom', 0, 1]]) \ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], [0, 'custom', 0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -125,9 +129,9 @@ function! s:suite.custom_void_string()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), 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, 2, 3]])
call s:assert.equals(SID('expand')([['readonly', 'filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], [0, 1]]) \ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], [0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -138,9 +142,9 @@ function! s:suite.custom_type_void_string()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), 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, 2, 3]])
call s:assert.equals(SID('expand')([['readonly', 'filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], [0, 1]]) \ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], [0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -151,9 +155,9 @@ function! s:suite.custom_number()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
\ [[['readonly', 'filename'], ['24'], ['modified']], [[0, 0], [1], [0]], [0, 1, 2, 3]]) \ [[['readonly', 'filename'], ['24'], ['modified']], [[0, 0], [1], [0]], [0, 1, 2, 3]])
call s:assert.equals(SID('expand')([['readonly', 'filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename', '24', 'modified']], [[0, 0, 1, 0]], [0, 1]]) \ [[['readonly', 'filename', '24', 'modified']], [[0, 0, 1, 0]], [0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -164,9 +168,9 @@ function! s:suite.custom_type_number()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
\ [[['readonly', 'filename'], ['24'], ['modified']], [[0, 0], [1], [0]], [0, 'custom', 2, 3]]) \ [[['readonly', 'filename'], ['24'], ['modified']], [[0, 0], [1], [0]], [0, 'custom', 2, 3]])
call s:assert.equals(SID('expand')([['readonly', 'filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename'], ['24'], ['modified']], [[0, 0], [1], [0]], [0, 'custom', 0, 1]]) \ [[['readonly', 'filename'], ['24'], ['modified']], [[0, 0], [1], [0]], [0, 'custom', 0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -177,9 +181,9 @@ function! s:suite.custom_void_string_array()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), 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, 2, 3]])
call s:assert.equals(SID('expand')([['readonly', 'filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], [0, 1]]) \ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], [0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -190,9 +194,9 @@ function! s:suite.custom_type_void_string_array()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), 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, 2, 3]])
call s:assert.equals(SID('expand')([['readonly', 'filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], [0, 1]]) \ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], [0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -203,9 +207,9 @@ function! s:suite.custom_void_string_array_2()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), 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, 2, 3]])
call s:assert.equals(SID('expand')([['readonly', 'filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], [0, 1]]) \ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], [0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -216,9 +220,9 @@ function! s:suite.custom_type_void_string_array_2()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), 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, 2, 3]])
call s:assert.equals(SID('expand')([['readonly', 'filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], [0, 1]]) \ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], [0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -229,9 +233,9 @@ function! s:suite.custom_void_string_array_3()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
\ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], [0, 1, 2, 3]]) \ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], [0, 1, 2, 3]])
call s:assert.equals(SID('expand')([['readonly', 'filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename', 'custom', 'modified']], [[0, 0, 1, 0]], [0, 1]]) \ [[['readonly', 'filename', 'custom', 'modified']], [[0, 0, 1, 0]], [0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -242,9 +246,9 @@ function! s:suite.custom_type_void_string_array_3()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
\ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], [0, 'custom', 2, 3]]) \ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], [0, 'custom', 2, 3]])
call s:assert.equals(SID('expand')([['readonly', 'filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], [0, 'custom', 0, 1]]) \ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], [0, 'custom', 0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -255,9 +259,9 @@ function! s:suite.custom_void_string_array_4()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
\ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], [0, 1, 2, 3]]) \ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], [0, 1, 2, 3]])
call s:assert.equals(SID('expand')([['readonly', 'filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename', 'custom', 'modified']], [[0, 0, 1, 0]], [0, 1]]) \ [[['readonly', 'filename', 'custom', 'modified']], [[0, 0, 1, 0]], [0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -268,9 +272,9 @@ function! s:suite.custom_type_void_string_array_4()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
\ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], [0, 'custom', 2, 3]]) \ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], [0, 'custom', 2, 3]])
call s:assert.equals(SID('expand')([['readonly', 'filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], [0, 'custom', 0, 1]]) \ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], [0, 'custom', 0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -281,9 +285,9 @@ function! s:suite.custom_left_nil()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['filename'], ['custom'], ['modified']]), call s:assert.equals(s:expand([['filename'], ['custom'], ['modified']]),
\ [[['filename'], ['y0', 'y1', 'z0', 'z1'], ['modified']], [[0], [1, 1, 1, 1], [0]], [0, 1, 2, 3]]) \ [[['filename'], ['y0', 'y1', 'z0', 'z1'], ['modified']], [[0], [1, 1, 1, 1], [0]], [0, 1, 2, 3]])
call s:assert.equals(SID('expand')([['filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['filename', 'custom', 'modified']]),
\ [[['filename', 'y0', 'y1', 'z0', 'z1', 'modified']], [[0, 1, 1, 1, 1, 0]], [0, 1]]) \ [[['filename', 'y0', 'y1', 'z0', 'z1', 'modified']], [[0, 1, 1, 1, 1, 0]], [0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -294,9 +298,9 @@ function! s:suite.custom_type_left_nil()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['filename'], ['custom'], ['modified']]), call s:assert.equals(s:expand([['filename'], ['custom'], ['modified']]),
\ [[['filename'], ['y0', 'y1'], ['z0', 'z1'], ['modified']], [[0], [1, 1], [1, 1], [0]], [0, 'custom', 1, 2, 3]]) \ [[['filename'], ['y0', 'y1'], ['z0', 'z1'], ['modified']], [[0], [1, 1], [1, 1], [0]], [0, 'custom', 1, 2, 3]])
call s:assert.equals(SID('expand')([['filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['filename', 'custom', 'modified']]),
\ [[['filename'], ['y0', 'y1'], ['z0', 'z1', 'modified']], [[0], [1, 1], [1, 1, 0]], [0, 'custom', 0, 1]]) \ [[['filename'], ['y0', 'y1'], ['z0', 'z1', 'modified']], [[0], [1, 1], [1, 1, 0]], [0, 'custom', 0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -307,9 +311,9 @@ function! s:suite.custom_right_nil()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['filename'], ['custom'], ['modified']]), call s:assert.equals(s:expand([['filename'], ['custom'], ['modified']]),
\ [[['filename'], ['x0', 'x1', 'y0', 'y1'], ['modified']], [[0], [1, 1, 1, 1], [0]], [0, 1, 2, 3]]) \ [[['filename'], ['x0', 'x1', 'y0', 'y1'], ['modified']], [[0], [1, 1, 1, 1], [0]], [0, 1, 2, 3]])
call s:assert.equals(SID('expand')([['filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['filename', 'custom', 'modified']]),
\ [[['filename', 'x0', 'x1', 'y0', 'y1', 'modified']], [[0, 1, 1, 1, 1, 0]], [0, 1]]) \ [[['filename', 'x0', 'x1', 'y0', 'y1', 'modified']], [[0, 1, 1, 1, 1, 0]], [0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -320,9 +324,9 @@ function! s:suite.custom_type_right_nil()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['filename'], ['custom'], ['modified']]), call s:assert.equals(s:expand([['filename'], ['custom'], ['modified']]),
\ [[['filename'], ['x0', 'x1'], ['y0', 'y1'], ['modified']], [[0], [1, 1], [1, 1], [0]], [0, 1, 'custom', 2, 3]]) \ [[['filename'], ['x0', 'x1'], ['y0', 'y1'], ['modified']], [[0], [1, 1], [1, 1], [0]], [0, 1, 'custom', 2, 3]])
call s:assert.equals(SID('expand')([['filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['filename', 'custom', 'modified']]),
\ [[['filename', 'x0', 'x1'], ['y0', 'y1'], ['modified']], [[0, 1, 1], [1, 1], [0]], [0, 'custom', 0, 1]]) \ [[['filename', 'x0', 'x1'], ['y0', 'y1'], ['modified']], [[0, 1, 1], [1, 1], [0]], [0, 'custom', 0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -333,9 +337,9 @@ function! s:suite.custom_one()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
\ [[['readonly', 'filename'], ['left'], ['modified']], [[0, 0], [1], [0]], [0, 1, 2, 3]]) \ [[['readonly', 'filename'], ['left'], ['modified']], [[0, 0], [1], [0]], [0, 1, 2, 3]])
call s:assert.equals(SID('expand')([['readonly', 'filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename', 'left', 'modified']], [[0, 0, 1, 0]], [0, 1]]) \ [[['readonly', 'filename', 'left', 'modified']], [[0, 0, 1, 0]], [0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -346,9 +350,9 @@ function! s:suite.custom_type_one()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
\ [[['readonly', 'filename'], ['left'], ['modified']], [[0, 0], [1], [0]], [0, 1, 2, 3]]) \ [[['readonly', 'filename'], ['left'], ['modified']], [[0, 0], [1], [0]], [0, 1, 2, 3]])
call s:assert.equals(SID('expand')([['readonly', 'filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename', 'left', 'modified']], [[0, 0, 1, 0]], [0, 1]]) \ [[['readonly', 'filename', 'left', 'modified']], [[0, 0, 1, 0]], [0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -359,9 +363,9 @@ function! s:suite.custom_two()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
\ [[['readonly', 'filename'], ['left', 'middle'], ['modified']], [[0, 0], [1, 1], [0]], [0, 1, 2, 3]]) \ [[['readonly', 'filename'], ['left', 'middle'], ['modified']], [[0, 0], [1, 1], [0]], [0, 1, 2, 3]])
call s:assert.equals(SID('expand')([['readonly', 'filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename', 'left', 'middle', 'modified']], [[0, 0, 1, 1, 0]], [0, 1]]) \ [[['readonly', 'filename', 'left', 'middle', 'modified']], [[0, 0, 1, 1, 0]], [0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -372,9 +376,9 @@ function! s:suite.custom_type_two()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
\ [[['readonly', 'filename'], ['left'], ['middle'], ['modified']], [[0, 0], [1], [1], [0]], [0, 1, 'custom', 2, 3]]) \ [[['readonly', 'filename'], ['left'], ['middle'], ['modified']], [[0, 0], [1], [1], [0]], [0, 1, 'custom', 2, 3]])
call s:assert.equals(SID('expand')([['readonly', 'filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename', 'left'], ['middle'], ['modified']], [[0, 0, 1], [1], [0]], [0, 'custom', 0, 1]]) \ [[['readonly', 'filename', 'left'], ['middle'], ['modified']], [[0, 0, 1], [1], [0]], [0, 'custom', 0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -385,9 +389,9 @@ function! s:suite.custom_mixed()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
\ [[['readonly', 'filename'], ['left', '{''custom'': 24}', 'function(''tr'')'], ['modified']], [[0, 0], [1, 1, 1], [0]], [0, 1, 2, 3]]) \ [[['readonly', 'filename'], ['left', '{''custom'': 24}', 'function(''tr'')'], ['modified']], [[0, 0], [1, 1, 1], [0]], [0, 1, 2, 3]])
call s:assert.equals(SID('expand')([['readonly', 'filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename', 'left', '{''custom'': 24}', 'function(''tr'')', 'modified']], [[0, 0, 1, 1, 1, 0]], [0, 1]]) \ [[['readonly', 'filename', 'left', '{''custom'': 24}', 'function(''tr'')', 'modified']], [[0, 0, 1, 1, 1, 0]], [0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -398,9 +402,9 @@ function! s:suite.custom_type_mixed()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
\ [[['readonly', 'filename'], ['left'], ['{''custom'': 24}'], ['function(''tr'')'], ['modified']], [[0, 0], [1], [1], [1], [0]], [0, 1, 'custom', 1, 2, 3]]) \ [[['readonly', 'filename'], ['left'], ['{''custom'': 24}'], ['function(''tr'')'], ['modified']], [[0, 0], [1], [1], [1], [0]], [0, 1, 'custom', 1, 2, 3]])
call s:assert.equals(SID('expand')([['readonly', 'filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename', 'left'], ['{''custom'': 24}'], ['function(''tr'')', 'modified']], [[0, 0, 1], [1], [1, 0]], [0, 'custom', 0, 1]]) \ [[['readonly', 'filename', 'left'], ['{''custom'': 24}'], ['function(''tr'')', 'modified']], [[0, 0, 1], [1], [1, 0]], [0, 'custom', 0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -411,9 +415,9 @@ function! s:suite.custom_mixed_2()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
\ [[['readonly', 'filename'], ['left', '{''custom'': 24}', '[function(''tr'')]'], ['modified']], [[0, 0], [1, 1, 1], [0]], [0, 1, 2, 3]]) \ [[['readonly', 'filename'], ['left', '{''custom'': 24}', '[function(''tr'')]'], ['modified']], [[0, 0], [1, 1, 1], [0]], [0, 1, 2, 3]])
call s:assert.equals(SID('expand')([['readonly', 'filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename', 'left', '{''custom'': 24}', '[function(''tr'')]', 'modified']], [[0, 0, 1, 1, 1, 0]], [0, 1]]) \ [[['readonly', 'filename', 'left', '{''custom'': 24}', '[function(''tr'')]', 'modified']], [[0, 0, 1, 1, 1, 0]], [0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -424,9 +428,9 @@ function! s:suite.custom_type_mixed_2()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
\ [[['readonly', 'filename'], ['left'], ['{''custom'': 24}'], ['[function(''tr'')]'], ['modified']], [[0, 0], [1], [1], [1], [0]], [0, 1, 'custom', 1, 2, 3]]) \ [[['readonly', 'filename'], ['left'], ['{''custom'': 24}'], ['[function(''tr'')]'], ['modified']], [[0, 0], [1], [1], [1], [0]], [0, 1, 'custom', 1, 2, 3]])
call s:assert.equals(SID('expand')([['readonly', 'filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename', 'left'], ['{''custom'': 24}'], ['[function(''tr'')]', 'modified']], [[0, 0, 1], [1], [1, 0]], [0, 'custom', 0, 1]]) \ [[['readonly', 'filename', 'left'], ['{''custom'': 24}'], ['[function(''tr'')]', 'modified']], [[0, 0, 1], [1], [1, 0]], [0, 'custom', 0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -438,9 +442,9 @@ function! s:suite.custom_error()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), 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, 2, 3]])
call s:assert.equals(SID('expand')([['readonly', 'filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], [0, 1]]) \ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], [0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -452,9 +456,9 @@ function! s:suite.custom_type_error()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), 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, 2, 3]])
call s:assert.equals(SID('expand')([['readonly', 'filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], [0, 1]]) \ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], [0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -462,18 +466,18 @@ endfunction
function! s:suite.notfound() function! s:suite.notfound()
let g:lightline = { 'component_expand': { 'custom': 'NotFound' } } let g:lightline = { 'component_expand': { 'custom': 'NotFound' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), 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, 2, 3]])
call s:assert.equals(SID('expand')([['readonly', 'filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], [0, 1]]) \ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], [0, 1]])
endfunction endfunction
function! s:suite.custom_type_notfound() function! s:suite.custom_type_notfound()
let g:lightline = { 'component_expand': { 'custom': 'NotFound' }, 'component_type': { 'custom': 'custom' } } let g:lightline = { 'component_expand': { 'custom': 'NotFound' }, 'component_type': { 'custom': 'custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['readonly', 'filename'], ['custom'], ['modified']]), 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, 2, 3]])
call s:assert.equals(SID('expand')([['readonly', 'filename', 'custom', 'modified']]), call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
\ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], [0, 1]]) \ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], [0, 1]])
endfunction endfunction
@@ -483,9 +487,9 @@ function! s:suite.duplicated_left_nil()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['filename'], ['custom', 'custom'], ['modified']]), call s:assert.equals(s:expand([['filename'], ['custom', 'custom'], ['modified']]),
\ [[['filename'], ['y0', 'y1', 'z0', 'z1', 'y0', 'y1', 'z0', 'z1'], ['modified']], [[0], [1, 1, 1, 1, 1, 1, 1, 1], [0]], [0, 1, 2, 3]]) \ [[['filename'], ['y0', 'y1', 'z0', 'z1', 'y0', 'y1', 'z0', 'z1'], ['modified']], [[0], [1, 1, 1, 1, 1, 1, 1, 1], [0]], [0, 1, 2, 3]])
call s:assert.equals(SID('expand')([['filename', 'custom', 'custom', 'modified']]), call s:assert.equals(s:expand([['filename', 'custom', 'custom', 'modified']]),
\ [[['filename', 'y0', 'y1', 'z0', 'z1', 'y0', 'y1', 'z0', 'z1', 'modified']], [[0, 1, 1, 1, 1, 1, 1, 1, 1, 0]], [0, 1]]) \ [[['filename', 'y0', 'y1', 'z0', 'z1', 'y0', 'y1', 'z0', 'z1', 'modified']], [[0, 1, 1, 1, 1, 1, 1, 1, 1, 0]], [0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -496,9 +500,9 @@ function! s:suite.duplicated_type_left_nil()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['filename'], ['custom', 'custom'], ['modified']]), call s:assert.equals(s:expand([['filename'], ['custom', 'custom'], ['modified']]),
\ [[['filename'], ['y0', 'y1'], ['z0', 'z1'], ['y0', 'y1'], ['z0', 'z1'], ['modified']], [[0], [1, 1], [1, 1], [1, 1], [1, 1], [0]], [0, 'custom', 1, 'custom', 1, 2, 3]]) \ [[['filename'], ['y0', 'y1'], ['z0', 'z1'], ['y0', 'y1'], ['z0', 'z1'], ['modified']], [[0], [1, 1], [1, 1], [1, 1], [1, 1], [0]], [0, 'custom', 1, 'custom', 1, 2, 3]])
call s:assert.equals(SID('expand')([['filename', 'custom', 'custom', 'modified']]), call s:assert.equals(s:expand([['filename', 'custom', 'custom', 'modified']]),
\ [[['filename'], ['y0', 'y1'], ['z0', 'z1'], ['y0', 'y1'], ['z0', 'z1', 'modified']], [[0], [1, 1], [1, 1], [1, 1], [1, 1, 0]], [0, 'custom', 0, 'custom', 0, 1]]) \ [[['filename'], ['y0', 'y1'], ['z0', 'z1'], ['y0', 'y1'], ['z0', 'z1', 'modified']], [[0], [1, 1], [1, 1], [1, 1], [1, 1, 0]], [0, 'custom', 0, 'custom', 0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -509,9 +513,9 @@ function! s:suite.duplicated_right_nil()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['filename'], ['custom', 'custom'], ['modified']]), call s:assert.equals(s:expand([['filename'], ['custom', 'custom'], ['modified']]),
\ [[['filename'], ['x0', 'x1', 'y0', 'y1', 'x0', 'x1', 'y0', 'y1'], ['modified']], [[0], [1, 1, 1, 1, 1, 1, 1, 1], [0]], [0, 1, 2, 3]]) \ [[['filename'], ['x0', 'x1', 'y0', 'y1', 'x0', 'x1', 'y0', 'y1'], ['modified']], [[0], [1, 1, 1, 1, 1, 1, 1, 1], [0]], [0, 1, 2, 3]])
call s:assert.equals(SID('expand')([['filename', 'custom', 'custom', 'modified']]), call s:assert.equals(s:expand([['filename', 'custom', 'custom', 'modified']]),
\ [[['filename', 'x0', 'x1', 'y0', 'y1', 'x0', 'x1', 'y0', 'y1', 'modified']], [[0, 1, 1, 1, 1, 1, 1, 1, 1, 0]], [0, 1]]) \ [[['filename', 'x0', 'x1', 'y0', 'y1', 'x0', 'x1', 'y0', 'y1', 'modified']], [[0, 1, 1, 1, 1, 1, 1, 1, 1, 0]], [0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -522,9 +526,9 @@ function! s:suite.duplicated_type_right_nil()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['filename'], ['custom', 'custom'], ['modified']]), call s:assert.equals(s:expand([['filename'], ['custom', 'custom'], ['modified']]),
\ [[['filename'], ['x0', 'x1'], ['y0', 'y1'], ['x0', 'x1'], ['y0', 'y1'], ['modified']], [[0], [1, 1], [1, 1], [1, 1], [1, 1], [0]], [0, 1, 'custom', 1, 'custom', 2, 3]]) \ [[['filename'], ['x0', 'x1'], ['y0', 'y1'], ['x0', 'x1'], ['y0', 'y1'], ['modified']], [[0], [1, 1], [1, 1], [1, 1], [1, 1], [0]], [0, 1, 'custom', 1, 'custom', 2, 3]])
call s:assert.equals(SID('expand')([['filename', 'custom', 'custom', 'modified']]), call s:assert.equals(s:expand([['filename', 'custom', 'custom', 'modified']]),
\ [[['filename', 'x0', 'x1'], ['y0', 'y1'], ['x0', 'x1'], ['y0', 'y1'], ['modified']], [[0, 1, 1], [1, 1], [1, 1], [1, 1], [0]], [0, 'custom', 0, 'custom', 0, 1]]) \ [[['filename', 'x0', 'x1'], ['y0', 'y1'], ['x0', 'x1'], ['y0', 'y1'], ['modified']], [[0, 1, 1], [1, 1], [1, 1], [1, 1], [0]], [0, 'custom', 0, 'custom', 0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -535,9 +539,9 @@ function! s:suite.duplicated_both_nil()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['filename'], ['custom', 'custom'], ['modified']]), call s:assert.equals(s:expand([['filename'], ['custom', 'custom'], ['modified']]),
\ [[['filename'], ['y0', 'y1', 'y0', 'y1'], ['modified']], [[0], [1, 1, 1, 1], [0]], [0, 1, 2, 3]]) \ [[['filename'], ['y0', 'y1', 'y0', 'y1'], ['modified']], [[0], [1, 1, 1, 1], [0]], [0, 1, 2, 3]])
call s:assert.equals(SID('expand')([['filename', 'custom', 'custom', 'modified']]), call s:assert.equals(s:expand([['filename', 'custom', 'custom', 'modified']]),
\ [[['filename', 'y0', 'y1', 'y0', 'y1', 'modified']], [[0, 1, 1, 1, 1, 0]], [0, 1]]) \ [[['filename', 'y0', 'y1', 'y0', 'y1', 'modified']], [[0, 1, 1, 1, 1, 0]], [0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -548,9 +552,9 @@ function! s:suite.duplicated_type_both_nil()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['filename'], ['custom', 'custom'], ['modified']]), call s:assert.equals(s:expand([['filename'], ['custom', 'custom'], ['modified']]),
\ [[['filename'], ['y0', 'y1', 'y0', 'y1'], ['modified']], [[0], [1, 1, 1, 1], [0]], [0, 'custom', 2, 3]]) \ [[['filename'], ['y0', 'y1', 'y0', 'y1'], ['modified']], [[0], [1, 1, 1, 1], [0]], [0, 'custom', 2, 3]])
call s:assert.equals(SID('expand')([['filename', 'custom', 'custom', 'modified']]), call s:assert.equals(s:expand([['filename', 'custom', 'custom', 'modified']]),
\ [[['filename'], ['y0', 'y1', 'y0', 'y1'], ['modified']], [[0], [1, 1, 1, 1], [0]], [0, 'custom', 0, 1]]) \ [[['filename'], ['y0', 'y1', 'y0', 'y1'], ['modified']], [[0], [1, 1, 1, 1], [0]], [0, 'custom', 0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -561,9 +565,9 @@ function! s:suite.duplicated_both_nil_left_most()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['custom', 'custom'], ['modified']]), call s:assert.equals(s:expand([['custom', 'custom'], ['modified']]),
\ [[['y0', 'y1', 'y0', 'y1'], ['modified']], [[1, 1, 1, 1], [0]], [0, 1, 2]]) \ [[['y0', 'y1', 'y0', 'y1'], ['modified']], [[1, 1, 1, 1], [0]], [0, 1, 2]])
call s:assert.equals(SID('expand')([['custom', 'custom', 'modified']]), call s:assert.equals(s:expand([['custom', 'custom', 'modified']]),
\ [[['y0', 'y1', 'y0', 'y1', 'modified']], [[1, 1, 1, 1, 0]], [0, 1]]) \ [[['y0', 'y1', 'y0', 'y1', 'modified']], [[1, 1, 1, 1, 0]], [0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -574,9 +578,9 @@ function! s:suite.duplicated_type_both_nil_left_most()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['custom', 'custom'], ['modified']]), call s:assert.equals(s:expand([['custom', 'custom'], ['modified']]),
\ [[['y0', 'y1', 'y0', 'y1'], ['modified']], [[1, 1, 1, 1], [0]], ['custom', 1, 2]]) \ [[['y0', 'y1', 'y0', 'y1'], ['modified']], [[1, 1, 1, 1], [0]], ['custom', 1, 2]])
call s:assert.equals(SID('expand')([['custom', 'custom', 'modified']]), call s:assert.equals(s:expand([['custom', 'custom', 'modified']]),
\ [[['y0', 'y1', 'y0', 'y1'], ['modified']], [[1, 1, 1, 1], [0]], ['custom', 0, 1]]) \ [[['y0', 'y1', 'y0', 'y1'], ['modified']], [[1, 1, 1, 1], [0]], ['custom', 0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -587,9 +591,9 @@ function! s:suite.duplicated_both_nil_right_most()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['filename'], ['custom', 'custom']]), call s:assert.equals(s:expand([['filename'], ['custom', 'custom']]),
\ [[['filename'], ['y0', 'y1', 'y0', 'y1']], [[0], [1, 1, 1, 1]], [0, 1, 2]]) \ [[['filename'], ['y0', 'y1', 'y0', 'y1']], [[0], [1, 1, 1, 1]], [0, 1, 2]])
call s:assert.equals(SID('expand')([['filename', 'custom', 'custom']]), call s:assert.equals(s:expand([['filename', 'custom', 'custom']]),
\ [[['filename', 'y0', 'y1', 'y0', 'y1']], [[0, 1, 1, 1, 1]], [0, 1]]) \ [[['filename', 'y0', 'y1', 'y0', 'y1']], [[0, 1, 1, 1, 1]], [0, 1]])
delfunction Custom delfunction Custom
endfunction endfunction
@@ -600,9 +604,9 @@ function! s:suite.duplicated_type_both_nil_right_most()
endfunction endfunction
let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } } let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
call lightline#init() call lightline#init()
call s:assert.equals(SID('expand')([['filename'], ['custom', 'custom']]), call s:assert.equals(s:expand([['filename'], ['custom', 'custom']]),
\ [[['filename'], ['y0', 'y1', 'y0', 'y1']], [[0], [1, 1, 1, 1]], [0, 'custom', 2]]) \ [[['filename'], ['y0', 'y1', 'y0', 'y1']], [[0], [1, 1, 1, 1]], [0, 'custom', 2]])
call s:assert.equals(SID('expand')([['filename', 'custom', 'custom']]), call s:assert.equals(s:expand([['filename', 'custom', 'custom']]),
\ [[['filename'], ['y0', 'y1', 'y0', 'y1']], [[0], [1, 1, 1, 1]], [0, 'custom', 1]]) \ [[['filename'], ['y0', 'y1', 'y0', 'y1']], [[0], [1, 1, 1, 1]], [0, 'custom', 1]])
delfunction Custom delfunction Custom
endfunction endfunction