From e49638ffc8dc97b108e986308dee1900db92e34e Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 30 Jul 2018 11:16:51 +0200 Subject: [PATCH] Upgrade vim-vspec to 1.8.1 (#862) This fixes some tests to make it work with the newer version. --- conftest.py | 4 +- test/completions.vim | 3 - test/completions_disabled.vim | 3 +- test/documentation.vim | 3 +- test/goto.vim | 112 +++++++++++++++++----------------- test/pyimport.vim | 3 +- test/signatures.vim | 5 +- 7 files changed, 63 insertions(+), 70 deletions(-) diff --git a/conftest.py b/conftest.py index 17d923e..ebedc2f 100644 --- a/conftest.py +++ b/conftest.py @@ -5,9 +5,9 @@ import zipfile import pytest -VSPEC_URL = 'https://github.com/kana/vim-vspec/archive/1.4.1.zip' +VSPEC_URL = 'https://github.com/kana/vim-vspec/archive/1.8.1.zip' CACHE_FOLDER = 'build' -VSPEC_FOLDER = os.path.join(CACHE_FOLDER, 'vim-vspec-1.4.1') +VSPEC_FOLDER = os.path.join(CACHE_FOLDER, 'vim-vspec-1.8.1') VSPEC_RUNNER = os.path.join(VSPEC_FOLDER, 'bin/vspec') TEST_DIR = 'test' diff --git a/test/completions.vim b/test/completions.vim index d75dc4f..aa6db08 100644 --- a/test/completions.vim +++ b/test/completions.vim @@ -63,9 +63,6 @@ describe 'completions' Expect getline('.') == 'raise BaseException' set completeopt +=longest end - - it 'dot_open' - end end " vim: et:ts=4:sw=4 diff --git a/test/completions_disabled.vim b/test/completions_disabled.vim index 37b7346..03d17c5 100644 --- a/test/completions_disabled.vim +++ b/test/completions_disabled.vim @@ -4,12 +4,11 @@ source plugin/jedi.vim describe 'completions_disabled' before - new set filetype=python end after - bd! + try | %bwipeout! | catch | endtry end it 'typing' diff --git a/test/documentation.vim b/test/documentation.vim index b60c2e1..e8d6a59 100644 --- a/test/documentation.vim +++ b/test/documentation.vim @@ -6,8 +6,7 @@ describe 'documentation docstrings' end after - bd! - bd! + try | %bwipeout! | catch | endtry end it 'simple' diff --git a/test/goto.vim b/test/goto.vim index 8c96ef5..e5c14b5 100644 --- a/test/goto.vim +++ b/test/goto.vim @@ -4,7 +4,7 @@ source test/_utils.vim describe 'goto simple' before - new " open a new split + new set filetype=python put =[ \ 'def a(): pass', @@ -27,18 +27,18 @@ describe 'goto simple' end it 'goto assignments' - silent normal \g + normal \g Expect line('.') == 2 Expect col('.') == 1 " cursor before `=` means that it stays there. - silent normal \g + normal \g Expect line('.') == 2 Expect col('.') == 1 " going to the last line changes it. normal! $ - silent normal \g + normal \g Expect line('.') == 1 Expect col('.') == 5 end @@ -52,47 +52,48 @@ describe 'goto with tabs' end after - bd! - bd! + try | %bwipeout! | catch | endtry end it 'follow import' put = ['import subprocess', 'subprocess'] - silent normal G\g + normal G\g Expect getline('.') == 'import subprocess' Expect line('.') == 2 Expect col('.') == 8 - silent normal G\d + normal G\d Expect CurrentBufferIsModule('subprocess') == 1 Expect line('.') == 1 Expect col('.') == 1 Expect tabpagenr('$') == 2 Expect winnr('$') == 1 - tabprevious + bwipe + + Expect tabpagenr('$') == 1 Expect bufname('%') == '' end - it 'multi definitions' - " This used to behave differently. Now we don't have any real multi - " definitions. - - " put = ['import tokenize'] - " silent normal G$\d - " Expect CurrentBufferIsModule('tokenize') == 1 - " Expect CurrentBufferIsModule('token') == 0 - " execute "normal \" - " Expect tabpagenr('$') == 2 - " Expect winnr('$') == 1 - " Expect CurrentBufferIsModule('token') == 1 - - " bd - " silent normal G$\d - " execute "normal j\" - " Expect tabpagenr('$') == 2 - " Expect winnr('$') == 1 - " Expect CurrentBufferIsModule('tokenize') == 1 - end + " it 'multi definitions' + " " This used to behave differently. Now we don't have any real multi + " " definitions. + " + " " put = ['import tokenize'] + " " normal G$\d + " " Expect CurrentBufferIsModule('tokenize') == 1 + " " Expect CurrentBufferIsModule('token') == 0 + " " execute "normal \" + " " Expect tabpagenr('$') == 2 + " " Expect winnr('$') == 1 + " " Expect CurrentBufferIsModule('token') == 1 + " + " " bd + " " normal G$\d + " " execute "normal j\" + " " Expect tabpagenr('$') == 2 + " " Expect winnr('$') == 1 + " " Expect CurrentBufferIsModule('tokenize') == 1 + " end end @@ -103,8 +104,7 @@ describe 'goto with buffers' end after - bd! - bd! + try | %bwipeout! | catch | endtry set nohidden end @@ -125,47 +125,47 @@ describe 'goto with buffers' Expect col('.') == 1 end - it 'multi definitions' - " set hidden - " put = ['import tokenize'] - " silent normal G$\d - " Expect CurrentBufferIsModule('tokenize') == 0 - " Expect CurrentBufferIsModule('token') == 0 - " execute "normal \" - " Expect tabpagenr('$') == 1 - " Expect winnr('$') == 1 - " Expect CurrentBufferIsModule('token') == 1 - - " bd - " silent normal G$\d - " execute "normal j\" - " Expect tabpagenr('$') == 1 - " Expect winnr('$') == 1 - " Expect CurrentBufferIsModule('tokenize') == 1 - end + " it 'multi definitions' + " " set hidden + " " put = ['import tokenize'] + " " normal G$\d + " " Expect CurrentBufferIsModule('tokenize') == 0 + " " Expect CurrentBufferIsModule('token') == 0 + " " execute "normal \" + " " Expect tabpagenr('$') == 1 + " " Expect winnr('$') == 1 + " " Expect CurrentBufferIsModule('token') == 1 + " + " " bd + " " normal G$\d + " " execute "normal j\" + " " Expect tabpagenr('$') == 1 + " " Expect winnr('$') == 1 + " " Expect CurrentBufferIsModule('tokenize') == 1 + " end end describe 'goto with splits' before + enew! set filetype=python let g:jedi#use_splits_not_buffers = 'left' end after - bd! - bd! + try | %bwipeout! | catch | endtry end it 'follow import' put = ['import subprocess', 'subprocess'] - silent normal G\g + normal G\g Expect getline('.') == 'import subprocess' Expect line('.') == 2 Expect col('.') == 8 - silent normal G\d + normal G\d Expect CurrentBufferIsModule('subprocess') == 1 Expect line('.') == 1 Expect col('.') == 1 @@ -179,6 +179,7 @@ end describe 'goto wildignore' before + enew! set filetype=python set wildignore=*,with\ spaces,*.pyc set hidden @@ -189,12 +190,11 @@ describe 'goto wildignore' put = ['from subprocess import Popen', 'Popen'] Expect CurrentBufferIsModule('subprocess') == 0 - silent normal G + normal G end after - bd! - bd! + try | %bwipeout! | catch | endtry set wildignore&vim end diff --git a/test/pyimport.vim b/test/pyimport.vim index 8b5f058..5a42a2a 100644 --- a/test/pyimport.vim +++ b/test/pyimport.vim @@ -7,8 +7,7 @@ describe 'pyimport' end after - bd! - bd! + try | %bwipeout! | catch | endtry end it 'open_tab' diff --git a/test/signatures.vim b/test/signatures.vim index 5b13546..9b8a3fc 100644 --- a/test/signatures.vim +++ b/test/signatures.vim @@ -2,12 +2,12 @@ source plugin/jedi.vim describe 'signatures' before + enew set filetype=python end after - bd! - bd! + try | %bwipeout! | catch | endtry end it 'simple' @@ -34,7 +34,6 @@ describe 'signatures' autocmd jedi_call_signatures * redir END Expect autocmds =~# 'jedi_call_signatures' - bd! end it 'simple after CursorHoldI with only parenthesis'