From f48031cde86b9d253ad4b3b5e5ddd35adf726cf5 Mon Sep 17 00:00:00 2001 From: Bailey Ling Date: Sat, 31 Aug 2013 23:51:55 +0000 Subject: [PATCH] test for window switching and active/inactive splits. --- t/airline.vim | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/t/airline.vim b/t/airline.vim index 179277ea..8cb0054a 100644 --- a/t/airline.vim +++ b/t/airline.vim @@ -1,5 +1,6 @@ call airline#init#bootstrap() call airline#init#sections() +source plugin/airline.vim function! MyFuncref(...) call a:1.add_raw('hello world') @@ -56,5 +57,26 @@ describe 'airline' call airline#remove_statusline_func('MyIgnoreFuncref') Expect len(g:airline_statusline_funcrefs) == c end + + it 'should overwrite the statusline with active and inactive splits' + wincmd s + Expect getwinvar(1, '&statusline') !~ 'inactive' + Expect getwinvar(2, '&statusline') =~ 'inactive' + wincmd c + end + + it 'should collapse the inactive split if the variable is set true' + let g:airline_inactive_collapse = 1 + wincmd s + Expect getwinvar(2, '&statusline') !~ 'airline#parts#mode' + wincmd c + end + + it 'should not collapse the inactive split if the variable is set false' + let g:airline_inactive_collapse = 0 + wincmd s + Expect getwinvar(2, '&statusline') != 'airline#parts#mode' + wincmd c + end end