From d09e0d2099e16bd0582bc02a9363d4359ec46f84 Mon Sep 17 00:00:00 2001 From: itchyny Date: Thu, 14 Apr 2016 00:18:23 +0900 Subject: [PATCH] add more tests for s:subseparator --- test/subseparator.vim | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/subseparator.vim b/test/subseparator.vim index e129cde..02cac4c 100644 --- a/test/subseparator.vim +++ b/test/subseparator.vim @@ -41,6 +41,18 @@ function! s:suite.subseparator_component_visible_condition_5() call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '') endfunction +function! s:suite.subseparator_component_visible_condition_6() + let g:lightline = { 'component': { 'custom1': 'custom1', 'custom2': 'custom2', 'custom3': 'custom3' }, 'component_visible_condition': { 'custom1': '1||0', 'custom2': '0', 'custom3': '0' } } + call lightline#init() + call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '') +endfunction + +function! s:suite.subseparator_component_visible_condition_7() + let g:lightline = { 'component': { 'custom1': 'custom1', 'custom2': 'custom2', 'custom3': 'custom3' }, 'component_visible_condition': { 'custom1': '1||1', 'custom2': '0', 'custom3': '0' } } + call lightline#init() + call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '') +endfunction + function! s:suite.subseparator_component_function() function! Custom1() return 'custom1'