From ba4e7552ec1f105337ac376ab83d4753af6ce366 Mon Sep 17 00:00:00 2001 From: itchyny Date: Tue, 22 Mar 2016 08:58:29 +0900 Subject: [PATCH] improve tests for s:expand --- test/expand.vim | 192 ++++++++++++++++++++++++------------------------ 1 file changed, 98 insertions(+), 94 deletions(-) diff --git a/test/expand.vim b/test/expand.vim index 79201e1..1aeaabd 100644 --- a/test/expand.vim +++ b/test/expand.vim @@ -1,17 +1,21 @@ let s:suite = themis#suite('expand') let s:assert = themis#helper('assert') +function! s:expand(...) + return call(SID('expand'), a:000) +endfunction + function! s:suite.expand() let g:lightline = {} call lightline#init() - call s:assert.equals(SID('expand')([]), + call s:assert.equals(s:expand([]), \ [[], [], [0]]) endfunction function! s:suite.default() let g:lightline = {} 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]]) endfunction @@ -21,9 +25,9 @@ function! s:suite.custom() endfunction let g:lightline = { 'component_expand': { 'custom': 'Custom' } } 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]]) - 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]]) delfunction Custom endfunction @@ -34,9 +38,9 @@ function! s:suite.custom_type() 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']]), + 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]]) - 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]]) delfunction Custom endfunction @@ -47,9 +51,9 @@ function! s:suite.multiple() endfunction let g:lightline = { 'component_expand': { 'custom': 'Custom' } } 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]]) - 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]]) delfunction Custom endfunction @@ -60,9 +64,9 @@ function! s:suite.multiple_type() 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']]), + 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]]) - 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]]) delfunction Custom endfunction @@ -73,9 +77,9 @@ function! s:suite.flatten() endfunction let g:lightline = { 'component_expand': { 'custom': 'Custom' } } 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]]) - 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]]) delfunction Custom endfunction @@ -86,9 +90,9 @@ function! s:suite.custom_type_flatten() 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']]), + 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]]) - 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]]) delfunction Custom endfunction @@ -99,9 +103,9 @@ function! s:suite.custom_string() endfunction let g:lightline = { 'component_expand': { 'custom': 'Custom' } } 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]]) - 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]]) delfunction Custom endfunction @@ -112,9 +116,9 @@ function! s:suite.custom_type_string() 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']]), + call s:assert.equals(s: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']]), + call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]), \ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], [0, 'custom', 0, 1]]) delfunction Custom endfunction @@ -125,9 +129,9 @@ function! s:suite.custom_void_string() endfunction let g:lightline = { 'component_expand': { 'custom': 'Custom' } } 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]]) - 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]]) delfunction Custom endfunction @@ -138,9 +142,9 @@ function! s:suite.custom_type_void_string() 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']]), + call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]), \ [[['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]]) delfunction Custom endfunction @@ -151,9 +155,9 @@ function! s:suite.custom_number() endfunction let g:lightline = { 'component_expand': { 'custom': 'Custom' } } 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]]) - 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]]) delfunction Custom endfunction @@ -164,9 +168,9 @@ function! s:suite.custom_type_number() 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']]), + call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]), \ [[['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]]) delfunction Custom endfunction @@ -177,9 +181,9 @@ function! s:suite.custom_void_string_array() endfunction let g:lightline = { 'component_expand': { 'custom': 'Custom' } } 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]]) - 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]]) delfunction Custom endfunction @@ -190,9 +194,9 @@ function! s:suite.custom_type_void_string_array() 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']]), + call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]), \ [[['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]]) delfunction Custom endfunction @@ -203,9 +207,9 @@ function! s:suite.custom_void_string_array_2() endfunction let g:lightline = { 'component_expand': { 'custom': 'Custom' } } 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]]) - 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]]) delfunction Custom endfunction @@ -216,9 +220,9 @@ function! s:suite.custom_type_void_string_array_2() 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']]), + call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]), \ [[['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]]) delfunction Custom endfunction @@ -229,9 +233,9 @@ function! s:suite.custom_void_string_array_3() endfunction let g:lightline = { 'component_expand': { 'custom': 'Custom' } } 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]]) - 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]]) delfunction Custom endfunction @@ -242,9 +246,9 @@ function! s:suite.custom_type_void_string_array_3() 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']]), + call s:assert.equals(s: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']]), + call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]), \ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], [0, 'custom', 0, 1]]) delfunction Custom endfunction @@ -255,9 +259,9 @@ function! s:suite.custom_void_string_array_4() endfunction let g:lightline = { 'component_expand': { 'custom': 'Custom' } } 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]]) - 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]]) delfunction Custom endfunction @@ -268,9 +272,9 @@ function! s:suite.custom_type_void_string_array_4() 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']]), + call s:assert.equals(s: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']]), + call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]), \ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], [0, 'custom', 0, 1]]) delfunction Custom endfunction @@ -281,9 +285,9 @@ function! s:suite.custom_left_nil() endfunction let g:lightline = { 'component_expand': { 'custom': 'Custom' } } 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]]) - 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]]) delfunction Custom endfunction @@ -294,9 +298,9 @@ function! s:suite.custom_type_left_nil() endfunction let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } } 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]]) - 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]]) delfunction Custom endfunction @@ -307,9 +311,9 @@ function! s:suite.custom_right_nil() endfunction let g:lightline = { 'component_expand': { 'custom': 'Custom' } } 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]]) - 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]]) delfunction Custom endfunction @@ -320,9 +324,9 @@ function! s:suite.custom_type_right_nil() endfunction let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } } 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]]) - 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]]) delfunction Custom endfunction @@ -333,9 +337,9 @@ function! s:suite.custom_one() endfunction let g:lightline = { 'component_expand': { 'custom': 'Custom' } } 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]]) - 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]]) delfunction Custom endfunction @@ -346,9 +350,9 @@ function! s:suite.custom_type_one() 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']]), + call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]), \ [[['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]]) delfunction Custom endfunction @@ -359,9 +363,9 @@ function! s:suite.custom_two() endfunction let g:lightline = { 'component_expand': { 'custom': 'Custom' } } 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]]) - 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]]) delfunction Custom endfunction @@ -372,9 +376,9 @@ function! s:suite.custom_type_two() 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']]), + 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]]) - 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]]) delfunction Custom endfunction @@ -385,9 +389,9 @@ function! s:suite.custom_mixed() endfunction let g:lightline = { 'component_expand': { 'custom': 'Custom' } } 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]]) - 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]]) delfunction Custom endfunction @@ -398,9 +402,9 @@ function! s:suite.custom_type_mixed() 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']]), + 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]]) - 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]]) delfunction Custom endfunction @@ -411,9 +415,9 @@ function! s:suite.custom_mixed_2() endfunction let g:lightline = { 'component_expand': { 'custom': 'Custom' } } 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]]) - 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]]) delfunction Custom endfunction @@ -424,9 +428,9 @@ function! s:suite.custom_type_mixed_2() 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']]), + 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]]) - 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]]) delfunction Custom endfunction @@ -438,9 +442,9 @@ function! s:suite.custom_error() endfunction let g:lightline = { 'component_expand': { 'custom': 'Custom' } } 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]]) - 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]]) delfunction Custom endfunction @@ -452,9 +456,9 @@ function! s:suite.custom_type_error() 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']]), + call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]), \ [[['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]]) delfunction Custom endfunction @@ -462,18 +466,18 @@ endfunction function! s:suite.notfound() let g:lightline = { 'component_expand': { 'custom': 'NotFound' } } 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]]) - 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]]) endfunction function! s:suite.custom_type_notfound() let g:lightline = { 'component_expand': { 'custom': 'NotFound' }, 'component_type': { 'custom': 'custom' } } 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]]) - 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]]) endfunction @@ -483,9 +487,9 @@ function! s:suite.duplicated_left_nil() endfunction let g:lightline = { 'component_expand': { 'custom': 'Custom' } } 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]]) - 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]]) delfunction Custom endfunction @@ -496,9 +500,9 @@ function! s:suite.duplicated_type_left_nil() endfunction let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } } 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]]) - 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]]) delfunction Custom endfunction @@ -509,9 +513,9 @@ function! s:suite.duplicated_right_nil() endfunction let g:lightline = { 'component_expand': { 'custom': 'Custom' } } 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]]) - 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]]) delfunction Custom endfunction @@ -522,9 +526,9 @@ function! s:suite.duplicated_type_right_nil() endfunction let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } } 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]]) - 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]]) delfunction Custom endfunction @@ -535,9 +539,9 @@ function! s:suite.duplicated_both_nil() endfunction let g:lightline = { 'component_expand': { 'custom': 'Custom' } } 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]]) - 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]]) delfunction Custom endfunction @@ -548,9 +552,9 @@ function! s:suite.duplicated_type_both_nil() endfunction let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } } 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]]) - 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]]) delfunction Custom endfunction @@ -561,9 +565,9 @@ function! s:suite.duplicated_both_nil_left_most() endfunction let g:lightline = { 'component_expand': { 'custom': 'Custom' } } 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]]) - 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]]) delfunction Custom endfunction @@ -574,9 +578,9 @@ function! s:suite.duplicated_type_both_nil_left_most() endfunction let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } } 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]]) - 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]]) delfunction Custom endfunction @@ -587,9 +591,9 @@ function! s:suite.duplicated_both_nil_right_most() endfunction let g:lightline = { 'component_expand': { 'custom': 'Custom' } } 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]]) - 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]]) delfunction Custom endfunction @@ -600,9 +604,9 @@ function! s:suite.duplicated_type_both_nil_right_most() endfunction let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } } 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]]) - 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]]) delfunction Custom endfunction