From 548e330fd8ac513cc1b39a9f13b873e504afa1cb Mon Sep 17 00:00:00 2001 From: ZyX Date: Tue, 6 Jan 2015 01:13:48 +0300 Subject: [PATCH] Add NERDTree tests --- tests/test_nerdtree_plugin.vim | 11 +++++++++++ tests/vim_utils.vim | 9 +++++++++ 2 files changed, 20 insertions(+) create mode 100755 tests/test_nerdtree_plugin.vim diff --git a/tests/test_nerdtree_plugin.vim b/tests/test_nerdtree_plugin.vim new file mode 100755 index 00000000..56b85b77 --- /dev/null +++ b/tests/test_nerdtree_plugin.vim @@ -0,0 +1,11 @@ +#!/usr/bin/vim -S +set nocompatible +set columns=80 +execute 'source' fnameescape(expand(':p:h').'/vim_utils.vim') +call EnablePlugins('nerdtree') +call SourcePowerline() +NERDTree /home +redrawstatus +call CheckCurrentStatusline('%#Pl_231_16777215_240_5789784_bold# /home %#Pl_240_5789784_236_3158064_NONE# %#Pl_231_16777215_236_3158064_NONE#                      ') +call CheckMessages() +qall diff --git a/tests/vim_utils.vim b/tests/vim_utils.vim index dc2b0e40..5922d454 100644 --- a/tests/vim_utils.vim +++ b/tests/vim_utils.vim @@ -46,6 +46,15 @@ endfunction function CheckRecordedStatuslineValue(expected) return CheckStatuslineValue(g:statusline_value, a:expected) endfunction +function GetCurrentStatusline() + if &l:statusline[:1] isnot# '%!' + ERR 'Statusline does not start with %!', &l:statusline + endif + return eval(&l:statusline[2:]) +endfunction +function CheckCurrentStatusline(expected) + return CheckStatuslineValue(GetCurrentStatusline(), a:expected) +endfunction function CheckMessages() if !empty(g:powerline_log_messages) LST ['Unexpected messages in log'] + g:powerline_log_messages