fix tests
Autotrigger is not supported for old versions of vim.
This commit is contained in:
parent
6c4fb6f3f2
commit
8ff84758a7
@ -1,8 +1,22 @@
|
|||||||
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"])
|
||||||
|
for line in output.split("\n"):
|
||||||
|
if line.startswith("Included patches:"):
|
||||||
|
patch = line.split('-')[1]
|
||||||
|
|
||||||
|
return int(patch) >= version
|
||||||
|
|
||||||
|
|
||||||
class Autotrigger_CanMatchSimpleTrigger(_VimTest):
|
class Autotrigger_CanMatchSimpleTrigger(_VimTest):
|
||||||
|
skip_if = lambda self: 'Vim newer than 7.4.214 is required' if \
|
||||||
|
not has_patch(214, self.vim._vim_executable) \
|
||||||
|
else None
|
||||||
files = { 'us/all.snippets': r"""
|
files = { 'us/all.snippets': r"""
|
||||||
snippet a "desc" A
|
snippet a "desc" A
|
||||||
autotriggered
|
autotriggered
|
||||||
@ -13,6 +27,9 @@ class Autotrigger_CanMatchSimpleTrigger(_VimTest):
|
|||||||
|
|
||||||
|
|
||||||
class Autotrigger_CanMatchContext(_VimTest):
|
class Autotrigger_CanMatchContext(_VimTest):
|
||||||
|
skip_if = lambda self: 'Vim newer than 7.4.214 is required' if \
|
||||||
|
not has_patch(214, self.vim._vim_executable) \
|
||||||
|
else None
|
||||||
files = { 'us/all.snippets': r"""
|
files = { 'us/all.snippets': r"""
|
||||||
snippet a "desc" "snip.line == 2" Ae
|
snippet a "desc" "snip.line == 2" Ae
|
||||||
autotriggered
|
autotriggered
|
||||||
|
Loading…
Reference in New Issue
Block a user