mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-07 19:24:36 +08:00
Upgrade vim-vspec to 1.8.1 (#862)
This fixes some tests to make it work with the newer version.
This commit is contained in:
committed by
Dave Halter
parent
4c430ed536
commit
e49638ffc8
@@ -5,9 +5,9 @@ import zipfile
|
|||||||
|
|
||||||
import pytest
|
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'
|
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')
|
VSPEC_RUNNER = os.path.join(VSPEC_FOLDER, 'bin/vspec')
|
||||||
TEST_DIR = 'test'
|
TEST_DIR = 'test'
|
||||||
|
|
||||||
|
|||||||
@@ -63,9 +63,6 @@ describe 'completions'
|
|||||||
Expect getline('.') == 'raise BaseException'
|
Expect getline('.') == 'raise BaseException'
|
||||||
set completeopt +=longest
|
set completeopt +=longest
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'dot_open'
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
" vim: et:ts=4:sw=4
|
" vim: et:ts=4:sw=4
|
||||||
|
|||||||
@@ -4,12 +4,11 @@ source plugin/jedi.vim
|
|||||||
|
|
||||||
describe 'completions_disabled'
|
describe 'completions_disabled'
|
||||||
before
|
before
|
||||||
new
|
|
||||||
set filetype=python
|
set filetype=python
|
||||||
end
|
end
|
||||||
|
|
||||||
after
|
after
|
||||||
bd!
|
try | %bwipeout! | catch | endtry
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'typing'
|
it 'typing'
|
||||||
|
|||||||
@@ -6,8 +6,7 @@ describe 'documentation docstrings'
|
|||||||
end
|
end
|
||||||
|
|
||||||
after
|
after
|
||||||
bd!
|
try | %bwipeout! | catch | endtry
|
||||||
bd!
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'simple'
|
it 'simple'
|
||||||
|
|||||||
112
test/goto.vim
112
test/goto.vim
@@ -4,7 +4,7 @@ source test/_utils.vim
|
|||||||
|
|
||||||
describe 'goto simple'
|
describe 'goto simple'
|
||||||
before
|
before
|
||||||
new " open a new split
|
new
|
||||||
set filetype=python
|
set filetype=python
|
||||||
put =[
|
put =[
|
||||||
\ 'def a(): pass',
|
\ 'def a(): pass',
|
||||||
@@ -27,18 +27,18 @@ describe 'goto simple'
|
|||||||
end
|
end
|
||||||
|
|
||||||
it 'goto assignments'
|
it 'goto assignments'
|
||||||
silent normal \g
|
normal \g
|
||||||
Expect line('.') == 2
|
Expect line('.') == 2
|
||||||
Expect col('.') == 1
|
Expect col('.') == 1
|
||||||
|
|
||||||
" cursor before `=` means that it stays there.
|
" cursor before `=` means that it stays there.
|
||||||
silent normal \g
|
normal \g
|
||||||
Expect line('.') == 2
|
Expect line('.') == 2
|
||||||
Expect col('.') == 1
|
Expect col('.') == 1
|
||||||
|
|
||||||
" going to the last line changes it.
|
" going to the last line changes it.
|
||||||
normal! $
|
normal! $
|
||||||
silent normal \g
|
normal \g
|
||||||
Expect line('.') == 1
|
Expect line('.') == 1
|
||||||
Expect col('.') == 5
|
Expect col('.') == 5
|
||||||
end
|
end
|
||||||
@@ -52,47 +52,48 @@ describe 'goto with tabs'
|
|||||||
end
|
end
|
||||||
|
|
||||||
after
|
after
|
||||||
bd!
|
try | %bwipeout! | catch | endtry
|
||||||
bd!
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'follow import'
|
it 'follow import'
|
||||||
put = ['import subprocess', 'subprocess']
|
put = ['import subprocess', 'subprocess']
|
||||||
silent normal G\g
|
normal G\g
|
||||||
Expect getline('.') == 'import subprocess'
|
Expect getline('.') == 'import subprocess'
|
||||||
Expect line('.') == 2
|
Expect line('.') == 2
|
||||||
Expect col('.') == 8
|
Expect col('.') == 8
|
||||||
|
|
||||||
silent normal G\d
|
normal G\d
|
||||||
Expect CurrentBufferIsModule('subprocess') == 1
|
Expect CurrentBufferIsModule('subprocess') == 1
|
||||||
Expect line('.') == 1
|
Expect line('.') == 1
|
||||||
Expect col('.') == 1
|
Expect col('.') == 1
|
||||||
Expect tabpagenr('$') == 2
|
Expect tabpagenr('$') == 2
|
||||||
Expect winnr('$') == 1
|
Expect winnr('$') == 1
|
||||||
tabprevious
|
bwipe
|
||||||
|
|
||||||
|
Expect tabpagenr('$') == 1
|
||||||
Expect bufname('%') == ''
|
Expect bufname('%') == ''
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'multi definitions'
|
" it 'multi definitions'
|
||||||
" This used to behave differently. Now we don't have any real multi
|
" " This used to behave differently. Now we don't have any real multi
|
||||||
" definitions.
|
" " definitions.
|
||||||
|
"
|
||||||
" put = ['import tokenize']
|
" " put = ['import tokenize']
|
||||||
" silent normal G$\d
|
" " normal G$\d
|
||||||
" Expect CurrentBufferIsModule('tokenize') == 1
|
" " Expect CurrentBufferIsModule('tokenize') == 1
|
||||||
" Expect CurrentBufferIsModule('token') == 0
|
" " Expect CurrentBufferIsModule('token') == 0
|
||||||
" execute "normal \<CR>"
|
" " execute "normal \<CR>"
|
||||||
" Expect tabpagenr('$') == 2
|
" " Expect tabpagenr('$') == 2
|
||||||
" Expect winnr('$') == 1
|
" " Expect winnr('$') == 1
|
||||||
" Expect CurrentBufferIsModule('token') == 1
|
" " Expect CurrentBufferIsModule('token') == 1
|
||||||
|
"
|
||||||
" bd
|
" " bd
|
||||||
" silent normal G$\d
|
" " normal G$\d
|
||||||
" execute "normal j\<CR>"
|
" " execute "normal j\<CR>"
|
||||||
" Expect tabpagenr('$') == 2
|
" " Expect tabpagenr('$') == 2
|
||||||
" Expect winnr('$') == 1
|
" " Expect winnr('$') == 1
|
||||||
" Expect CurrentBufferIsModule('tokenize') == 1
|
" " Expect CurrentBufferIsModule('tokenize') == 1
|
||||||
end
|
" end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -103,8 +104,7 @@ describe 'goto with buffers'
|
|||||||
end
|
end
|
||||||
|
|
||||||
after
|
after
|
||||||
bd!
|
try | %bwipeout! | catch | endtry
|
||||||
bd!
|
|
||||||
set nohidden
|
set nohidden
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -125,47 +125,47 @@ describe 'goto with buffers'
|
|||||||
Expect col('.') == 1
|
Expect col('.') == 1
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'multi definitions'
|
" it 'multi definitions'
|
||||||
" set hidden
|
" " set hidden
|
||||||
" put = ['import tokenize']
|
" " put = ['import tokenize']
|
||||||
" silent normal G$\d
|
" " normal G$\d
|
||||||
" Expect CurrentBufferIsModule('tokenize') == 0
|
" " Expect CurrentBufferIsModule('tokenize') == 0
|
||||||
" Expect CurrentBufferIsModule('token') == 0
|
" " Expect CurrentBufferIsModule('token') == 0
|
||||||
" execute "normal \<CR>"
|
" " execute "normal \<CR>"
|
||||||
" Expect tabpagenr('$') == 1
|
" " Expect tabpagenr('$') == 1
|
||||||
" Expect winnr('$') == 1
|
" " Expect winnr('$') == 1
|
||||||
" Expect CurrentBufferIsModule('token') == 1
|
" " Expect CurrentBufferIsModule('token') == 1
|
||||||
|
"
|
||||||
" bd
|
" " bd
|
||||||
" silent normal G$\d
|
" " normal G$\d
|
||||||
" execute "normal j\<CR>"
|
" " execute "normal j\<CR>"
|
||||||
" Expect tabpagenr('$') == 1
|
" " Expect tabpagenr('$') == 1
|
||||||
" Expect winnr('$') == 1
|
" " Expect winnr('$') == 1
|
||||||
" Expect CurrentBufferIsModule('tokenize') == 1
|
" " Expect CurrentBufferIsModule('tokenize') == 1
|
||||||
end
|
" end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
describe 'goto with splits'
|
describe 'goto with splits'
|
||||||
before
|
before
|
||||||
|
enew!
|
||||||
set filetype=python
|
set filetype=python
|
||||||
let g:jedi#use_splits_not_buffers = 'left'
|
let g:jedi#use_splits_not_buffers = 'left'
|
||||||
end
|
end
|
||||||
|
|
||||||
after
|
after
|
||||||
bd!
|
try | %bwipeout! | catch | endtry
|
||||||
bd!
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'follow import'
|
it 'follow import'
|
||||||
put = ['import subprocess', 'subprocess']
|
put = ['import subprocess', 'subprocess']
|
||||||
silent normal G\g
|
normal G\g
|
||||||
Expect getline('.') == 'import subprocess'
|
Expect getline('.') == 'import subprocess'
|
||||||
Expect line('.') == 2
|
Expect line('.') == 2
|
||||||
Expect col('.') == 8
|
Expect col('.') == 8
|
||||||
|
|
||||||
silent normal G\d
|
normal G\d
|
||||||
Expect CurrentBufferIsModule('subprocess') == 1
|
Expect CurrentBufferIsModule('subprocess') == 1
|
||||||
Expect line('.') == 1
|
Expect line('.') == 1
|
||||||
Expect col('.') == 1
|
Expect col('.') == 1
|
||||||
@@ -179,6 +179,7 @@ end
|
|||||||
|
|
||||||
describe 'goto wildignore'
|
describe 'goto wildignore'
|
||||||
before
|
before
|
||||||
|
enew!
|
||||||
set filetype=python
|
set filetype=python
|
||||||
set wildignore=*,with\ spaces,*.pyc
|
set wildignore=*,with\ spaces,*.pyc
|
||||||
set hidden
|
set hidden
|
||||||
@@ -189,12 +190,11 @@ describe 'goto wildignore'
|
|||||||
|
|
||||||
put = ['from subprocess import Popen', 'Popen']
|
put = ['from subprocess import Popen', 'Popen']
|
||||||
Expect CurrentBufferIsModule('subprocess') == 0
|
Expect CurrentBufferIsModule('subprocess') == 0
|
||||||
silent normal G
|
normal G
|
||||||
end
|
end
|
||||||
|
|
||||||
after
|
after
|
||||||
bd!
|
try | %bwipeout! | catch | endtry
|
||||||
bd!
|
|
||||||
set wildignore&vim
|
set wildignore&vim
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,7 @@ describe 'pyimport'
|
|||||||
end
|
end
|
||||||
|
|
||||||
after
|
after
|
||||||
bd!
|
try | %bwipeout! | catch | endtry
|
||||||
bd!
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'open_tab'
|
it 'open_tab'
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ source plugin/jedi.vim
|
|||||||
|
|
||||||
describe 'signatures'
|
describe 'signatures'
|
||||||
before
|
before
|
||||||
|
enew
|
||||||
set filetype=python
|
set filetype=python
|
||||||
end
|
end
|
||||||
|
|
||||||
after
|
after
|
||||||
bd!
|
try | %bwipeout! | catch | endtry
|
||||||
bd!
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'simple'
|
it 'simple'
|
||||||
@@ -34,7 +34,6 @@ describe 'signatures'
|
|||||||
autocmd jedi_call_signatures * <buffer>
|
autocmd jedi_call_signatures * <buffer>
|
||||||
redir END
|
redir END
|
||||||
Expect autocmds =~# 'jedi_call_signatures'
|
Expect autocmds =~# 'jedi_call_signatures'
|
||||||
bd!
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'simple after CursorHoldI with only parenthesis'
|
it 'simple after CursorHoldI with only parenthesis'
|
||||||
|
|||||||
Reference in New Issue
Block a user