Skip to content

Commit 8043f4d

Browse files
authored
Merge pull request #745 from Milly/Deprecated.Text.Sexp-fix-test-skip
Deprecated.Text.Sexp: skip the before block in test
2 parents 869b9e3 + 544aac9 commit 8043f4d

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

test/Deprecated/Text/Sexp.vim

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@ scriptencoding utf-8
22

33
let s:suite = themis#suite('Deprecated.Text.Sexp')
44
let s:assert = themis#helper('assert')
5+
let s:has_lua = has('lua') && exists('*luaeval')
56

67
function! s:suite.before()
8+
if !s:has_lua
9+
return
10+
endif
711
let s:S = vital#vital#new().import('Deprecated.Text.Sexp')
812
endfunction
913

@@ -12,10 +16,16 @@ function! s:suite.after()
1216
endfunction
1317

1418
function! s:suite.parse()
15-
if !has('lua') || !exists('*luaeval')
19+
if !s:has_lua
1620
call s:assert.skip('Vital.Deprecated.Text.Sexp: any function call needs if_lua')
1721
endif
18-
call s:assert.equals(
19-
\ s:S.parse('(a b c)'),
20-
\ [[{'label': 'identifier', 'col': 2.0, 'matched_text': 'a'}, {'label': 'whitespace', 'col': 3.0, 'matched_text': ' '}, {'label': 'identifier', 'col': 4.0, 'matched_text': 'b'}, {'label': 'whitespace', 'col': 5.0, 'matched_text': ' '}, {'label': 'identifier', 'col': 6.0, 'matched_text': 'c'}]])
22+
if has('patch-8.2.0775')
23+
call s:assert.equals(
24+
\ s:S.parse('(a b c)'),
25+
\ [[{'label': 'identifier', 'col': 2, 'matched_text': 'a'}, {'label': 'whitespace', 'col': 3, 'matched_text': ' '}, {'label': 'identifier', 'col': 4, 'matched_text': 'b'}, {'label': 'whitespace', 'col': 5, 'matched_text': ' '}, {'label': 'identifier', 'col': 6, 'matched_text': 'c'}]])
26+
else
27+
call s:assert.equals(
28+
\ s:S.parse('(a b c)'),
29+
\ [[{'label': 'identifier', 'col': 2.0, 'matched_text': 'a'}, {'label': 'whitespace', 'col': 3.0, 'matched_text': ' '}, {'label': 'identifier', 'col': 4.0, 'matched_text': 'b'}, {'label': 'whitespace', 'col': 5.0, 'matched_text': ' '}, {'label': 'identifier', 'col': 6.0, 'matched_text': 'c'}]])
30+
endif
2131
endfunction

0 commit comments

Comments
 (0)