@@ -2,8 +2,12 @@ scriptencoding utf-8
2
2
3
3
let s: suite = themis#suite (' Deprecated.Text.Sexp' )
4
4
let s: assert = themis#helper (' assert' )
5
+ let s: has_lua = has (' lua' ) && exists (' *luaeval' )
5
6
6
7
function ! s: suite .before ()
8
+ if ! s: has_lua
9
+ return
10
+ endif
7
11
let s: S = vital#vital#new ().import (' Deprecated.Text.Sexp' )
8
12
endfunction
9
13
@@ -12,10 +16,16 @@ function! s:suite.after()
12
16
endfunction
13
17
14
18
function ! s: suite .parse ()
15
- if ! has ( ' lua ' ) || ! exists ( ' *luaeval ' )
19
+ if ! s: has_lua
16
20
call s: assert .skip (' Vital.Deprecated.Text.Sexp: any function call needs if_lua' )
17
21
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
21
31
endfunction
0 commit comments