diff --git a/tests/run_vim_tests.sh b/tests/run_vim_tests.sh index f8efac60..c6261752 100755 --- a/tests/run_vim_tests.sh +++ b/tests/run_vim_tests.sh @@ -1,13 +1,42 @@ #!/bin/sh . tests/bot-ci/scripts/common/main.sh -VIM=$PWD/tests/bot-ci/deps/vim/tip-$PYTHON_VERSION/vim FAILED=0 -for script in tests/test_*.vim ; do - if ! $VIM -u NONE -S $script || test -f message.fail ; then + +if test -z "$VIM" ; then + NEW_VIM="$PWD/tests/bot-ci/deps/vim/tip-$PYTHON_VERSION/vim" + OLD_VIM="$PWD/tests/bot-ci/deps/vim/v7-0-112-$PYTHON_VERSION/vim" + if test -e "$OLD_VIM" ; then + VIMS="NEW_VIM OLD_VIM" + else + VIMS="NEW_VIM" + fi +else + NEW_VIM="$VIM" + OLD_VIM="$VIM" +fi + +test_script() { + local vim="$1" + local script="$2" + echo "Running script $script with $vim" + if ! "$vim" -u NONE -S $script || test -f message.fail ; then echo "Failed script $script run with $VIM" >&2 cat message.fail >&2 rm message.fail FAILED=1 fi +} + +for script in tests/test_*.vim ; do + if test "${script%.old.vim}" = "${script}" ; then + test_script "$NEW_VIM" "$script" + fi done + +if test -e "$OLD_VIM" ; then + for script in tests/test_*.old.vim ; do + test_script "$OLD_VIM" "$script" + done +fi + exit $FAILED diff --git a/tests/test_empty_encoding.old.vim b/tests/test_empty_encoding.old.vim new file mode 100755 index 00000000..c14e0045 --- /dev/null +++ b/tests/test_empty_encoding.old.vim @@ -0,0 +1,32 @@ +#!/usr/bin/vim -S +if has('multibyte') + if empty(&encoding) + call writefile(['&encoding option value is empty, even though Vim has +multibyte'], 'message.fail') + cquit + endif + qall +endif +if !empty(&encoding) + call writefile(['&encoding option value is not empty, even though Vim does not have +multibyte'], 'message.fail') + cquit +endif + +let g:powerline_config_paths = [expand(':p:h:h') . '/powerline/config_files'] + +try + source powerline/bindings/vim/plugin/powerline.vim +catch + call writefile(['Unexpected exception:', v:exception], 'message.fail') + cquit +endtry +set ls=2 +redrawstatus! +redir => g:messages + messages +redir END +let mess=split(g:messages, "\n") +if len(mess)>1 + call writefile(['Unexpected message(s):']+mess, 'message.fail') + cquit +endif +qall!