disable tests in vanilla vim for #616
This commit is contained in:
parent
45e3775c18
commit
5a2dcc5cbf
@ -1,23 +1,10 @@
|
|||||||
from test.vim_test_case import VimTestCase as _VimTest
|
from test.vim_test_case import VimTestCase as _VimTest
|
||||||
from test.constant import *
|
from test.constant import *
|
||||||
|
|
||||||
import subprocess
|
|
||||||
|
|
||||||
|
|
||||||
def has_patch(version, executable):
|
|
||||||
output = subprocess.check_output([executable, "--version"])
|
|
||||||
patch = 1
|
|
||||||
for line in output.decode('utf-8').split("\n"):
|
|
||||||
if line.startswith("Included patches:"):
|
|
||||||
patch = line.split('-')[1]
|
|
||||||
|
|
||||||
return int(patch) >= version
|
|
||||||
|
|
||||||
|
|
||||||
def check_required_vim_version(test):
|
def check_required_vim_version(test):
|
||||||
if test.vim_flavor == 'neovim':
|
if test.vim_flavor == 'neovim':
|
||||||
return None
|
return None
|
||||||
if not has_patch(214, test.vim._vim_executable):
|
if not test.vim.has_patch(214):
|
||||||
return 'Vim newer than 7.4.214 is required'
|
return 'Vim newer than 7.4.214 is required'
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
@ -58,7 +45,7 @@ class Autotrigger_CanExpandOnTriggerWithLengthMoreThanOne(_VimTest):
|
|||||||
|
|
||||||
class Autotrigger_WillProduceNoExceptionWithVimLowerThan214(_VimTest):
|
class Autotrigger_WillProduceNoExceptionWithVimLowerThan214(_VimTest):
|
||||||
skip_if = lambda self: 'Vim older than 7.4.214 is required' \
|
skip_if = lambda self: 'Vim older than 7.4.214 is required' \
|
||||||
if has_patch(214, self.vim._vim_executable) else None
|
if self.vim.has_patch(214) else None
|
||||||
|
|
||||||
files = { 'us/all.snippets': r"""
|
files = { 'us/all.snippets': r"""
|
||||||
snippet abc "desc" A
|
snippet abc "desc" A
|
||||||
|
@ -1,6 +1,16 @@
|
|||||||
from test.vim_test_case import VimTestCase as _VimTest
|
from test.vim_test_case import VimTestCase as _VimTest
|
||||||
from test.constant import *
|
from test.constant import *
|
||||||
|
|
||||||
|
|
||||||
|
def check_required_vim_version(test):
|
||||||
|
if test.vim_flavor == 'neovim':
|
||||||
|
return None
|
||||||
|
if not test.vim.has_patch(1):
|
||||||
|
return 'Vim newer than 7.4.1 is required'
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
# Undo of Snippet insertion {{{#
|
# Undo of Snippet insertion {{{#
|
||||||
|
|
||||||
|
|
||||||
@ -122,11 +132,13 @@ class Backspace_TabStop_NotZero(_VimTest):
|
|||||||
# End: Pressing BS in TabStop #}}}
|
# End: Pressing BS in TabStop #}}}
|
||||||
|
|
||||||
class UpdateModifiedSnippetWithoutCursorMove(_VimTest):
|
class UpdateModifiedSnippetWithoutCursorMove(_VimTest):
|
||||||
|
skip_if = check_required_vim_version
|
||||||
snippets = ('test', '${1:one}(${2:xxx})${3:three}')
|
snippets = ('test', '${1:one}(${2:xxx})${3:three}')
|
||||||
keys = 'test' + EX + 'aaaaa' + JF + BS + JF + '3333'
|
keys = 'test' + EX + 'aaaaa' + JF + BS + JF + '3333'
|
||||||
wanted = 'aaaaa()3333'
|
wanted = 'aaaaa()3333'
|
||||||
|
|
||||||
class UpdateModifiedSnippetWithoutCursorMove2(_VimTest):
|
class UpdateModifiedSnippetWithoutCursorMove2(_VimTest):
|
||||||
|
skip_if = check_required_vim_version
|
||||||
snippets = ('test', '''\
|
snippets = ('test', '''\
|
||||||
private function ${1:functionName}(${2:arguments}):${3:Void}
|
private function ${1:functionName}(${2:arguments}):${3:Void}
|
||||||
{
|
{
|
||||||
|
@ -91,6 +91,20 @@ class VimInterface(TempFileManager):
|
|||||||
def __init__(self, vim_executable, name):
|
def __init__(self, vim_executable, name):
|
||||||
TempFileManager.__init__(self, name)
|
TempFileManager.__init__(self, name)
|
||||||
self._vim_executable = vim_executable
|
self._vim_executable = vim_executable
|
||||||
|
self._patch_version = None
|
||||||
|
|
||||||
|
def has_patch(self, version):
|
||||||
|
if self._patch_version is None:
|
||||||
|
output = subprocess.check_output([
|
||||||
|
self._vim_executable, "--version"
|
||||||
|
])
|
||||||
|
|
||||||
|
self._patch_version = 0
|
||||||
|
for line in output.decode('utf-8').split("\n"):
|
||||||
|
if line.startswith("Included patches:"):
|
||||||
|
self._patch_version = line.split('-')[1]
|
||||||
|
|
||||||
|
return int(self._patch_version) >= version
|
||||||
|
|
||||||
def get_buffer_data(self):
|
def get_buffer_data(self):
|
||||||
buffer_path = self.unique_name_temp(prefix='buffer_')
|
buffer_path = self.unique_name_temp(prefix='buffer_')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user