Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 00af3ae

Browse files
committedNov 23, 2020
Do not put ! for :function
This is only necessary for development phase with old Vim.
1 parent 91669b1 commit 00af3ae

38 files changed

+475
-475
lines changed
 

‎autoload/themis.vim

+13-13
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ let g:themis#vital = vital#themis#new()
1717

1818
let s:version = '1.5.5'
1919

20-
function! themis#version() abort
20+
function themis#version() abort
2121
return s:version
2222
endfunction
2323

24-
function! themis#run(paths, ...) abort
24+
function themis#run(paths, ...) abort
2525
let s:current_runner = themis#runner#new()
2626
try
2727
let options = get(a:000, 0, themis#option#empty_options())
@@ -33,30 +33,30 @@ endfunction
3333

3434
" -- Utilities for test
3535

36-
function! s:runner() abort
36+
function s:runner() abort
3737
if !exists('s:current_runner')
3838
throw 'themis: Test is not running.'
3939
endif
4040
return s:current_runner
4141
endfunction
4242

43-
function! themis#bundle(title) abort
43+
function themis#bundle(title) abort
4444
let base_bundle = s:runner().get_loading_bundle()
4545
let new_bundle = themis#bundle#new(a:title)
4646
call base_bundle.add_child(new_bundle)
4747
return new_bundle
4848
endfunction
4949

50-
function! themis#suite(...) abort
50+
function themis#suite(...) abort
5151
let title = get(a:000, 0, '')
5252
return themis#bundle(title).suite
5353
endfunction
5454

55-
function! themis#helper(name) abort
55+
function themis#helper(name) abort
5656
return themis#helper#{a:name}#new(s:runner())
5757
endfunction
5858

59-
function! themis#option(...) abort
59+
function themis#option(...) abort
6060
if !exists('s:custom_options')
6161
let s:custom_options = themis#option#default()
6262
endif
@@ -77,20 +77,20 @@ function! themis#option(...) abort
7777
endif
7878
endfunction
7979

80-
function! themis#func_alias(dict) abort
80+
function themis#func_alias(dict) abort
8181
call themis#util#func_alias(a:dict, [])
8282
endfunction
8383

84-
function! themis#exception(type, message) abort
84+
function themis#exception(type, message) abort
8585
return printf('themis: %s: %s', a:type, themis#message(a:message))
8686
endfunction
8787

88-
function! themis#log(expr, ...) abort
88+
function themis#log(expr, ...) abort
8989
let mes = themis#message(a:expr) . "\n"
9090
call call('themis#logn', [mes] + a:000)
9191
endfunction
9292

93-
function! themis#logn(expr, ...) abort
93+
function themis#logn(expr, ...) abort
9494
let string = themis#message(a:expr)
9595
if !empty(a:000)
9696
let string = call('printf', [string] + a:000)
@@ -104,15 +104,15 @@ function! themis#logn(expr, ...) abort
104104
endif
105105
endfunction
106106

107-
function! themis#message(expr) abort
107+
function themis#message(expr) abort
108108
let t = type(a:expr)
109109
return
110110
\ t == type('') ? a:expr :
111111
\ t == type([]) ? join(map(copy(a:expr), 'themis#message(v:val)'), "\n") :
112112
\ string(a:expr)
113113
endfunction
114114

115-
function! themis#failure(expr) abort
115+
function themis#failure(expr) abort
116116
return 'themis: report: failure: ' . themis#message(a:expr)
117117
endfunction
118118

‎autoload/themis/bundle.vim

+20-20
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,24 @@ let s:Bundle = {
1111
\ 'children': [],
1212
\ }
1313

14-
function! s:Bundle.get_title() abort
14+
function s:Bundle.get_title() abort
1515
return get(self, 'title', '')
1616
endfunction
1717

18-
function! s:Bundle.get_test_full_title(entry) abort
18+
function s:Bundle.get_test_full_title(entry) abort
1919
return themis#util#get_full_title(self, [self.get_test_title(a:entry)])
2020
endfunction
2121

22-
function! s:Bundle.get_test_title(entry) abort
22+
function s:Bundle.get_test_title(entry) abort
2323
let description = self.get_description(a:entry)
2424
return description !=# '' ? description : a:entry
2525
endfunction
2626

27-
function! s:Bundle.get_description(entry) abort
27+
function s:Bundle.get_description(entry) abort
2828
return get(self.suite_descriptions, a:entry, '')
2929
endfunction
3030

31-
function! s:Bundle.get_style() abort
31+
function s:Bundle.get_style() abort
3232
if has_key(self, 'style')
3333
return self.style
3434
endif
@@ -38,23 +38,23 @@ function! s:Bundle.get_style() abort
3838
return {}
3939
endfunction
4040

41-
function! s:Bundle.has_parent() abort
41+
function s:Bundle.has_parent() abort
4242
return has_key(self, 'parent')
4343
endfunction
4444

45-
function! s:Bundle.get_parent() abort
45+
function s:Bundle.get_parent() abort
4646
return get(self, 'parent', {})
4747
endfunction
4848

49-
function! s:Bundle.add_child(bundle) abort
49+
function s:Bundle.add_child(bundle) abort
5050
if has_key(a:bundle, 'parent')
5151
call a:bundle.parent.remove_child(a:bundle)
5252
endif
5353
let self.children += [a:bundle]
5454
let a:bundle.parent = self
5555
endfunction
5656

57-
function! s:Bundle.get_child(title) abort
57+
function s:Bundle.get_child(title) abort
5858
for child in self.children
5959
if child.title ==# a:title
6060
return child
@@ -63,7 +63,7 @@ function! s:Bundle.get_child(title) abort
6363
return {}
6464
endfunction
6565

66-
function! s:Bundle.remove_child(child) abort
66+
function s:Bundle.remove_child(child) abort
6767
for i in range(len(self.children))
6868
if self.children[i] is a:child
6969
call remove(a:child, 'parent')
@@ -73,53 +73,53 @@ function! s:Bundle.remove_child(child) abort
7373
endfor
7474
endfunction
7575

76-
function! s:Bundle.total_test_count() abort
76+
function s:Bundle.total_test_count() abort
7777
return len(self.get_test_entries())
7878
\ + s:sum(map(copy(self.children), 'v:val.total_test_count()'))
7979
endfunction
8080

81-
function! s:Bundle.get_test_entries() abort
81+
function s:Bundle.get_test_entries() abort
8282
if !has_key(self, 'test_entries')
8383
let self.test_entries = self.all_test_entries()
8484
endif
8585
return self.test_entries
8686
endfunction
8787

88-
function! s:Bundle.select_tests_recursive(pattern) abort
88+
function s:Bundle.select_tests_recursive(pattern) abort
8989
for child in self.children
9090
call child.select_tests_recursive(a:pattern)
9191
endfor
9292
call self.select_tests(a:pattern)
9393
return !self.is_empty()
9494
endfunction
9595

96-
function! s:Bundle.select_tests(pattern) abort
96+
function s:Bundle.select_tests(pattern) abort
9797
let test_entries = self.all_test_entries()
9898
call filter(test_entries, 'self.get_test_full_title(v:val) =~# a:pattern')
9999
let self.test_entries = test_entries
100100
endfunction
101101

102-
function! s:Bundle.all_test_entries() abort
102+
function s:Bundle.all_test_entries() abort
103103
let style = self.get_style()
104104
if empty(style)
105105
return []
106106
endif
107107
return style.get_test_names(self)
108108
endfunction
109109

110-
function! s:Bundle.is_empty() abort
110+
function s:Bundle.is_empty() abort
111111
return self.total_test_count() == 0
112112
endfunction
113113

114-
function! s:Bundle.run_test(entry) abort
114+
function s:Bundle.run_test(entry) abort
115115
call self.suite[a:entry]()
116116
endfunction
117117

118-
function! s:sum(list) abort
118+
function s:sum(list) abort
119119
return empty(a:list) ? 0 : eval(join(a:list, '+'))
120120
endfunction
121121

122-
function! themis#bundle#new(...) abort
122+
function themis#bundle#new(...) abort
123123
let bundle = deepcopy(s:Bundle)
124124
let bundle.title = 1 <= a:0 ? a:1 : ''
125125
if 2 <= a:0 && has_key(a:2, 'add_child')
@@ -128,7 +128,7 @@ function! themis#bundle#new(...) abort
128128
return bundle
129129
endfunction
130130

131-
function! themis#bundle#is_bundle(obj) abort
131+
function themis#bundle#is_bundle(obj) abort
132132
return type(a:obj) == type({}) &&
133133
\ get(a:obj, 'run_test') is get(s:Bundle, 'run_test')
134134
endfunction

‎autoload/themis/command.vim

+12-12
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
let s:save_cpo = &cpo
66
set cpo&vim
77

8-
function! themis#command#start(args) abort
8+
function themis#command#start(args) abort
99
let [paths, options] = s:parse_args(a:args)
1010
if get(options, 'exit', 0)
1111
return
@@ -24,7 +24,7 @@ let s:short_options = {
2424
\ 'r': 'recursive',
2525
\ 'v': 'version',
2626
\ }
27-
function! s:parse_args(args) abort
27+
function s:parse_args(args) abort
2828
let paths = []
2929
let options = themis#option#empty_options()
3030
let args = copy(a:args)
@@ -47,49 +47,49 @@ function! s:parse_args(args) abort
4747
endfunction
4848

4949
let s:options = {}
50-
function! s:options.exclude(args, options) abort
50+
function s:options.exclude(args, options) abort
5151
if empty(a:args)
5252
throw 'themis: --exclude option requires {pattern}'
5353
endif
5454
let a:options.exclude += [remove(a:args, 0)]
5555
endfunction
5656

57-
function! s:options.target(args, options) abort
57+
function s:options.target(args, options) abort
5858
if empty(a:args)
5959
throw 'themis: --target option requires {pattern}'
6060
endif
6161
let a:options.target += [remove(a:args, 0)]
6262
endfunction
6363

64-
function! s:options.recursive(args, options) abort
64+
function s:options.recursive(args, options) abort
6565
let a:options.recursive = 1
6666
endfunction
6767

68-
function! s:options.reporter(args, options) abort
68+
function s:options.reporter(args, options) abort
6969
if empty(a:args)
7070
throw 'themis: --reporter option requires {name}'
7171
endif
7272
let a:options.reporter = remove(a:args, 0)
7373
endfunction
7474

75-
function! s:options.reporter_list(args, options) abort
75+
function s:options.reporter_list(args, options) abort
7676
let reporters = themis#module#list('reporter')
7777
call themis#log(join(reporters, "\n"))
7878
let a:options.exit = 1
7979
endfunction
8080

81-
function! s:options.runtimepath(args, options) abort
81+
function s:options.runtimepath(args, options) abort
8282
if empty(a:args)
8383
throw 'themis: --runtime option requires {path}'
8484
endif
8585
let a:options.runtimepath += [remove(a:args, 0)]
8686
endfunction
8787

88-
function! s:options.debug(args, options) abort
88+
function s:options.debug(args, options) abort
8989
let $THEMIS_DEBUG = 1
9090
endfunction
9191

92-
function! s:options.help(args, options) abort
92+
function s:options.help(args, options) abort
9393
" TODO: automate options
9494
call themis#log(join([
9595
\ 'themis: A testing framework for Vim script.',
@@ -107,12 +107,12 @@ function! s:options.help(args, options) abort
107107
let a:options.exit = 1
108108
endfunction
109109

110-
function! s:options.version(args, options) abort
110+
function s:options.version(args, options) abort
111111
call themis#log('themis version ' . themis#version())
112112
let a:options.exit = 1
113113
endfunction
114114

115-
function! s:process_option(name, args, options) abort
115+
function s:process_option(name, args, options) abort
116116
let name = substitute(a:name, '-', '_', 'g')
117117
if has_key(s:options, name)
118118
call s:options[name](a:args, a:options)

‎autoload/themis/emitter.vim

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,43 @@ let s:Emitter = {
99
\ '_listeners': [],
1010
\ }
1111

12-
function! s:Emitter.add_listener(listener) abort
12+
function s:Emitter.add_listener(listener) abort
1313
call add(self._listeners, a:listener)
1414
endfunction
1515

16-
function! s:Emitter.get_listeners() abort
16+
function s:Emitter.get_listeners() abort
1717
return copy(self._listeners)
1818
endfunction
1919

20-
function! s:Emitter.emit(event, ...) abort
20+
function s:Emitter.emit(event, ...) abort
2121
let self._emitting = a:event
2222
for listener in self._listeners
2323
call themis#emitter#fire(listener, a:event, a:000)
2424
endfor
2525
unlet self._emitting
2626
endfunction
2727

28-
function! s:Emitter.emitting() abort
28+
function s:Emitter.emitting() abort
2929
return get(self, '_emitting', '')
3030
endfunction
3131

32-
function! s:Emitter.remove_listener(listener) abort
32+
function s:Emitter.remove_listener(listener) abort
3333
call filter(self._listeners, 'v:val isnot a:listener')
3434
endfunction
3535

36-
function! s:Emitter.remove_all_listeners() abort
36+
function s:Emitter.remove_all_listeners() abort
3737
let self._listeners = []
3838
endfunction
3939

40-
function! themis#emitter#fire(listener, event, args) abort
40+
function themis#emitter#fire(listener, event, args) abort
4141
if has_key(a:listener, a:event)
4242
call call(a:listener[a:event], a:args, a:listener)
4343
elseif has_key(a:listener, '_')
4444
call call(a:listener['_'], [a:event, a:args], a:listener)
4545
endif
4646
endfunction
4747

48-
function! themis#emitter#new() abort
48+
function themis#emitter#new() abort
4949
return deepcopy(s:Emitter)
5050
endfunction
5151

‎autoload/themis/helper/assert.vim

+38-38
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,19 @@ for s:aliased_type in keys(s:type_aliases)
3333
\ 'is_not_' . s:type_aliases[s:aliased_type]
3434
endfor
3535

36-
function! s:assert_fail(mes) abort
36+
function s:assert_fail(mes) abort
3737
throw themis#failure(a:mes)
3838
endfunction
3939

40-
function! s:assert_todo(...) abort
40+
function s:assert_todo(...) abort
4141
throw 'themis: report: todo:' . themis#message(a:0 ? a:1 : 'TODO')
4242
endfunction
4343

44-
function! s:assert_skip(mes) abort
44+
function s:assert_skip(mes) abort
4545
throw 'themis: report: SKIP:' . themis#message(a:mes)
4646
endfunction
4747

48-
function! s:assert_true(value, ...) abort
48+
function s:assert_true(value, ...) abort
4949
if a:value isnot 1 && a:value isnot s:true
5050
throw s:failure([
5151
\ 'The true value was expected, but it was not the case.',
@@ -57,7 +57,7 @@ function! s:assert_true(value, ...) abort
5757
return 1
5858
endfunction
5959

60-
function! s:assert_false(value, ...) abort
60+
function s:assert_false(value, ...) abort
6161
if a:value isnot 0 && a:value isnot s:false
6262
throw s:failure([
6363
\ 'The false value was expected, but it was not the case.',
@@ -69,7 +69,7 @@ function! s:assert_false(value, ...) abort
6969
return 1
7070
endfunction
7171

72-
function! s:assert_truthy(value, ...) abort
72+
function s:assert_truthy(value, ...) abort
7373
let t = type(a:value)
7474
if !(t == type(0) || t == type('') || t == type(s:true)) || !a:value
7575
throw s:failure([
@@ -82,7 +82,7 @@ function! s:assert_truthy(value, ...) abort
8282
return 1
8383
endfunction
8484

85-
function! s:assert_falsy(value, ...) abort
85+
function s:assert_falsy(value, ...) abort
8686
let t = type(a:value)
8787
if (t != type(0) && t != type('') && t != type(s:false)) || a:value
8888
throw s:failure([
@@ -95,7 +95,7 @@ function! s:assert_falsy(value, ...) abort
9595
return 1
9696
endfunction
9797

98-
function! s:assert_compare(left, expr, right, ...) abort
98+
function s:assert_compare(left, expr, right, ...) abort
9999
let expr_str = join([string(a:left), a:expr, string(a:right)])
100100
try
101101
let result = eval(join(['a:left', a:expr, 'a:right']))
@@ -119,7 +119,7 @@ function! s:assert_compare(left, expr, right, ...) abort
119119
return 1
120120
endfunction
121121

122-
function! s:assert_equals(actual, expect, ...) abort
122+
function s:assert_equals(actual, expect, ...) abort
123123
if !s:equals(a:expect, a:actual)
124124
throw s:failure([
125125
\ 'The equivalent values were expected, but it was not the case.',
@@ -131,7 +131,7 @@ function! s:assert_equals(actual, expect, ...) abort
131131
return 1
132132
endfunction
133133

134-
function! s:assert_not_equals(actual, expect, ...) abort
134+
function s:assert_not_equals(actual, expect, ...) abort
135135
if s:equals(a:expect, a:actual)
136136
throw s:failure([
137137
\ 'Not the equivalent values were expected, but it was not the case.',
@@ -143,7 +143,7 @@ function! s:assert_not_equals(actual, expect, ...) abort
143143
return 1
144144
endfunction
145145

146-
function! s:assert_same(actual, expect, ...) abort
146+
function s:assert_same(actual, expect, ...) abort
147147
if a:expect isnot# a:actual
148148
throw s:failure([
149149
\ 'The same values were expected, but it was not the case.',
@@ -155,7 +155,7 @@ function! s:assert_same(actual, expect, ...) abort
155155
return 1
156156
endfunction
157157

158-
function! s:assert_not_same(actual, expect, ...) abort
158+
function s:assert_not_same(actual, expect, ...) abort
159159
if a:expect is# a:actual
160160
throw s:failure([
161161
\ 'Not the same values were expected, but it was not the case.',
@@ -167,7 +167,7 @@ function! s:assert_not_same(actual, expect, ...) abort
167167
return 1
168168
endfunction
169169

170-
function! s:assert_match(actual, pattern, ...) abort
170+
function s:assert_match(actual, pattern, ...) abort
171171
if !s:match(a:actual, a:pattern)
172172
throw s:failure([
173173
\ 'Match was expected, but did not match.',
@@ -179,7 +179,7 @@ function! s:assert_match(actual, pattern, ...) abort
179179
return 1
180180
endfunction
181181

182-
function! s:assert_not_match(actual, pattern, ...) abort
182+
function s:assert_not_match(actual, pattern, ...) abort
183183
if s:match(a:actual, a:pattern)
184184
throw s:failure([
185185
\ 'Not match was expected, but matched.',
@@ -193,22 +193,22 @@ endfunction
193193

194194
for [s:type_value, s:type_name] in items(s:type_names)
195195
execute printf(join([
196-
\ 'function! s:assert_is_%s(value, ...) abort',
196+
\ 'function s:assert_is_%s(value, ...) abort',
197197
\ ' return s:check_type(a:value, %s, 0, a:000)',
198198
\ 'endfunction',
199199
\ ], "\n"), s:type_name, string(s:type_name))
200200
execute printf(join([
201-
\ 'function! s:assert_is_not_%s(value, ...) abort',
201+
\ 'function s:assert_is_not_%s(value, ...) abort',
202202
\ ' return s:check_type(a:value, %s, 1, a:000)',
203203
\ 'endfunction',
204204
\ ], "\n"), s:type_name, string(s:type_name))
205205
endfor
206206

207-
function! s:assert_type_of(value, names, ...) abort
207+
function s:assert_type_of(value, names, ...) abort
208208
return s:check_type(a:value, a:names, 0, a:000)
209209
endfunction
210210

211-
function! s:assert_length_of(value, length, ...) abort
211+
function s:assert_length_of(value, length, ...) abort
212212
call s:assert_type_of(a:value, ['String', 'List', 'Dictionary'])
213213
let got_length = len(a:value)
214214
if got_length != a:length
@@ -223,7 +223,7 @@ function! s:assert_length_of(value, length, ...) abort
223223
return 1
224224
endfunction
225225

226-
function! s:assert_has_key(value, key, ...) abort
226+
function s:assert_has_key(value, key, ...) abort
227227
let t = type(a:value)
228228
if t == type({})
229229
if !has_key(a:value, a:key)
@@ -255,7 +255,7 @@ function! s:assert_has_key(value, key, ...) abort
255255
return 1
256256
endfunction
257257

258-
function! s:assert_key_exists(value, key, ...) abort
258+
function s:assert_key_exists(value, key, ...) abort
259259
call call('s:assert_is_dictionary', [a:value] + a:000)
260260
if !has_key(a:value, a:key)
261261
throw s:failure([
@@ -268,7 +268,7 @@ function! s:assert_key_exists(value, key, ...) abort
268268
return 1
269269
endfunction
270270

271-
function! s:assert_key_not_exists(value, key, ...) abort
271+
function s:assert_key_not_exists(value, key, ...) abort
272272
call call('s:assert_is_dictionary', [a:value] + a:000)
273273
if has_key(a:value, a:key)
274274
throw s:failure([
@@ -281,7 +281,7 @@ function! s:assert_key_not_exists(value, key, ...) abort
281281
return 1
282282
endfunction
283283

284-
function! s:assert_exists(expr, ...) abort
284+
function s:assert_exists(expr, ...) abort
285285
if !exists(a:expr)
286286
throw s:failure([
287287
\ 'The target was expected to exist, but it did not exist.',
@@ -292,7 +292,7 @@ function! s:assert_exists(expr, ...) abort
292292
return 1
293293
endfunction
294294

295-
function! s:assert_not_exists(expr, ...) abort
295+
function s:assert_not_exists(expr, ...) abort
296296
if exists(a:expr)
297297
throw s:failure([
298298
\ 'The target was expected to not exist, but it did exist.',
@@ -303,7 +303,7 @@ function! s:assert_not_exists(expr, ...) abort
303303
return 1
304304
endfunction
305305

306-
function! s:assert_cmd_exists(expr, ...) abort
306+
function s:assert_cmd_exists(expr, ...) abort
307307
let cmd = a:expr[0] ==# ':' ? a:expr : ':' . a:expr
308308
if exists(cmd) != 2
309309
throw s:failure([
@@ -315,7 +315,7 @@ function! s:assert_cmd_exists(expr, ...) abort
315315
return 1
316316
endfunction
317317

318-
function! s:assert_cmd_not_exists(expr, ...) abort
318+
function s:assert_cmd_not_exists(expr, ...) abort
319319
let cmd = a:expr[0] ==# ':' ? a:expr : ':' . a:expr
320320
if exists(cmd) == 2
321321
throw s:failure([
@@ -327,7 +327,7 @@ function! s:assert_cmd_not_exists(expr, ...) abort
327327
return 1
328328
endfunction
329329

330-
function! s:assert_empty(expr, ...) abort
330+
function s:assert_empty(expr, ...) abort
331331
if !empty(a:expr)
332332
throw s:failure([
333333
\ 'The target was expected to be empty, but it wasn''t.',
@@ -338,7 +338,7 @@ function! s:assert_empty(expr, ...) abort
338338
return 1
339339
endfunction
340340

341-
function! s:assert_not_empty(expr, ...) abort
341+
function s:assert_not_empty(expr, ...) abort
342342
if empty(a:expr)
343343
throw s:failure([
344344
\ 'The target was expected not to be empty, but it was.',
@@ -349,30 +349,30 @@ function! s:assert_not_empty(expr, ...) abort
349349
return 1
350350
endfunction
351351

352-
function! s:equals(a, b) abort
352+
function s:equals(a, b) abort
353353
if s:is_invalid_string_as_num(a:a, a:b) ||
354354
\ s:is_invalid_string_as_num(a:b, a:a)
355355
return 0
356356
endif
357357
return s:T.is_comparable(a:a, a:b) && a:a ==# a:b
358358
endfunction
359359

360-
function! s:is_invalid_string_as_num(a, b) abort
360+
function s:is_invalid_string_as_num(a, b) abort
361361
return type(a:a) == type('') &&
362362
\ type(a:b) == type(0) && a:a !~# '^-\?\d\+$'
363363
endfunction
364364

365-
function! s:match(str, pattern) abort
365+
function s:match(str, pattern) abort
366366
return type(a:str) == type('') &&
367367
\ type(a:pattern) == type('') &&
368368
\ a:str =~# a:pattern
369369
endfunction
370370

371-
function! s:type(value) abort
371+
function s:type(value) abort
372372
return s:type_names[type(a:value)]
373373
endfunction
374374

375-
function! s:check_type(value, expected_types, not, additional_message) abort
375+
function s:check_type(value, expected_types, not, additional_message) abort
376376
let got_type = s:type(a:value)
377377
let expected_types = s:type(a:expected_types) ==# 'list' ?
378378
\ copy(a:expected_types) : [a:expected_types]
@@ -407,14 +407,14 @@ function! s:check_type(value, expected_types, not, additional_message) abort
407407
return 1
408408
endfunction
409409

410-
function! s:failure(mes, additional) abort
410+
function s:failure(mes, additional) abort
411411
if empty(a:additional)
412412
return themis#failure(a:mes)
413413
endif
414414
return themis#failure(a:mes + [''] + a:additional)
415415
endfunction
416416

417-
function! s:redir(cmd) abort
417+
function s:redir(cmd) abort
418418
let [save_verbose, save_verbosefile] = [&verbose, &verbosefile]
419419
set verbose=0 verbosefile=
420420
redir => res
@@ -424,7 +424,7 @@ function! s:redir(cmd) abort
424424
return res
425425
endfunction
426426

427-
function! s:get_functions(sid) abort
427+
function s:get_functions(sid) abort
428428
let prefix = '<SNR>' . a:sid . '_'
429429
let funcs = s:redir('function')
430430
let filter_pat = '^\s*function ' . prefix
@@ -434,11 +434,11 @@ function! s:get_functions(sid) abort
434434
\ 'matchstr(v:val, map_pat)')
435435
endfunction
436436

437-
function! s:sid() abort
437+
function s:sid() abort
438438
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_\w\+$')
439439
endfunction
440440

441-
function! s:make_helper() abort
441+
function s:make_helper() abort
442442
let functions = s:get_functions(s:sid())
443443
let assert_pat = '^<SNR>\d\+_assert_'
444444
call filter(functions, 'v:val =~# assert_pat')
@@ -455,7 +455,7 @@ endfunction
455455

456456
let s:helper = s:make_helper()
457457

458-
function! themis#helper#assert#new(runner) abort
458+
function themis#helper#assert#new(runner) abort
459459
return deepcopy(s:helper)
460460
endfunction
461461

‎autoload/themis/helper/command.vim

+24-24
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ let s:helper = {
1414
let s:c = {} " This is used in commands.
1515
let s:current_scopes = {}
1616

17-
function! s:get_throws_args(value) abort
17+
function s:get_throws_args(value) abort
1818
return matchlist(a:value, '\v^\s*%(/(%(\\.|[^/])*)/)?\s*(.*)')[1 : 2]
1919
endfunction
2020

21-
function! s:wrap_exception(exception, lnum) abort
21+
function s:wrap_exception(exception, lnum) abort
2222
" TODO: Duplicate code
2323
let result = matchstr(a:exception, '\c^themis:\_s*report:\_s*\zs.*')
2424
if result ==# ''
@@ -36,7 +36,7 @@ function! s:wrap_exception(exception, lnum) abort
3636
\ )
3737
endfunction
3838

39-
function! s:fail(lnum, result) abort
39+
function s:fail(lnum, result) abort
4040
let stack = themis#util#parse_callstack(expand('<sfile>'))[-2]
4141
throw themis#failure([
4242
\ 'The truthy value was expected, but it was not the case.',
@@ -48,7 +48,7 @@ function! s:fail(lnum, result) abort
4848
\ ])
4949
endfunction
5050

51-
function! s:not_thrown(lnum, expected_exception, result) abort
51+
function s:not_thrown(lnum, expected_exception, result) abort
5252
let stack = themis#util#parse_callstack(expand('<sfile>'))[-2]
5353
throw themis#failure([
5454
\ 'An exception thrown was expected, but not thrown.',
@@ -60,7 +60,7 @@ function! s:not_thrown(lnum, expected_exception, result) abort
6060
\ ])
6161
endfunction
6262

63-
function! s:check_exception(lnum, thrown_exception, expected_exception) abort
63+
function s:check_exception(lnum, thrown_exception, expected_exception) abort
6464
if a:expected_exception !=# '' && a:thrown_exception !~# a:expected_exception
6565
let stack = themis#util#parse_callstack(expand('<sfile>'))[-2]
6666
throw themis#failure([
@@ -74,7 +74,7 @@ function! s:check_exception(lnum, thrown_exception, expected_exception) abort
7474
endif
7575
endfunction
7676

77-
function! s:define_assert(command, scope_key) abort
77+
function s:define_assert(command, scope_key) abort
7878
execute 'command! -nargs=+' a:command
7979
\ ' try'
8080
\ '| let s:c.result = s:eval(<q-args>, s:current_scopes.' . a:scope_key . ' + [l:])'
@@ -86,7 +86,7 @@ function! s:define_assert(command, scope_key) abort
8686
\ '| endif'
8787
endfunction
8888

89-
function! s:define_throws(command, scope_key) abort
89+
function s:define_throws(command, scope_key) abort
9090
execute 'command! -nargs=+' a:command
9191
\ ' let s:c.not_thrown = 0'
9292
\ '| let [s:c.expect_exception, s:c.expr] = s:get_throws_args(<q-args>)'
@@ -101,7 +101,7 @@ function! s:define_throws(command, scope_key) abort
101101
\ '| endif'
102102
endfunction
103103

104-
function! s:define_fail(command) abort
104+
function s:define_fail(command) abort
105105
execute 'command! -nargs=*' a:command
106106
\ ' if <q-args> !=# ""'
107107
\ '| throw themis#failure(<q-args>)'
@@ -110,7 +110,7 @@ function! s:define_fail(command) abort
110110
\ '| endif'
111111
endfunction
112112

113-
function! s:define_todo(command) abort
113+
function s:define_todo(command) abort
114114
execute 'command! -nargs=*' a:command
115115
\ ' if <q-args> !=# ""'
116116
\ '| throw "themis: report: todo:" . <q-args>'
@@ -119,7 +119,7 @@ function! s:define_todo(command) abort
119119
\ '| endif'
120120
endfunction
121121

122-
function! s:define_skip(command) abort
122+
function s:define_skip(command) abort
123123
execute 'command! -nargs=*' a:command
124124
\ ' if <q-args> !=# ""'
125125
\ '| throw "themis: report: SKIP:" . <q-args>'
@@ -128,17 +128,17 @@ function! s:define_skip(command) abort
128128
\ '| endif'
129129
endfunction
130130

131-
function! s:helper.prefix(prefix) abort
131+
function s:helper.prefix(prefix) abort
132132
let self._prefix = a:prefix
133133
return self
134134
endfunction
135135

136-
function! s:helper.with(...) abort
136+
function s:helper.with(...) abort
137137
call extend(self._scopes, a:000)
138138
return self
139139
endfunction
140140

141-
function! s:helper.define() abort
141+
function s:helper.define() abort
142142
call s:define_assert(self._prefix . 'Assert', '_' . self._prefix)
143143
call s:define_throws(self._prefix . 'Throws', '_' . self._prefix)
144144
call s:define_fail(self._prefix . 'Fail')
@@ -147,21 +147,21 @@ function! s:helper.define() abort
147147
let s:current_scopes['_' . self._prefix] = self._scopes
148148
endfunction
149149

150-
function! s:helper.undef() abort
150+
function s:helper.undef() abort
151151
call s:delcommand(self._prefix . 'Assert')
152152
call s:delcommand(self._prefix . 'Throws')
153153
call s:delcommand(self._prefix . 'Fail')
154154
call s:delcommand(self._prefix . 'TODO')
155155
call s:delcommand(self._prefix . 'Skip')
156156
unlet! s:current_scopes['_' . self._prefix]
157157
endfunction
158-
function! s:helper.defined() abort
158+
function s:helper.defined() abort
159159
return exists(':' . self._prefix . 'Assert') == 2
160160
endfunction
161161

162162

163163
let s:events = {'helper': s:helper, 'nest': 0, 'skip': 0}
164-
function! s:events.before_suite(bundle) abort
164+
function s:events.before_suite(bundle) abort
165165
if self.is_target(a:bundle)
166166
if self.nest == 0
167167
if self.helper.defined()
@@ -174,7 +174,7 @@ function! s:events.before_suite(bundle) abort
174174
endif
175175
endfunction
176176

177-
function! s:events.after_suite(bundle) abort
177+
function s:events.after_suite(bundle) abort
178178
if self.is_target(a:bundle)
179179
let self.nest -= 1
180180
if self.nest == 0 && !self.skip
@@ -183,22 +183,22 @@ function! s:events.after_suite(bundle) abort
183183
endif
184184
endfunction
185185

186-
function! s:events.is_target(bundle) abort
186+
function s:events.is_target(bundle) abort
187187
return self.target_bundle is a:bundle
188188
endfunction
189189

190-
function! s:check_truthy(value) abort
190+
function s:check_truthy(value) abort
191191
let t = type(a:value)
192192
return (t == type(0) || t == type('')) && a:value
193193
endfunction
194194

195-
function! s:delcommand(cmd) abort
195+
function s:delcommand(cmd) abort
196196
if exists(':' . a:cmd) == 2
197197
execute 'delcommand' a:cmd
198198
endif
199199
endfunction
200200

201-
function! s:eval(expr, scopes) abort
201+
function s:eval(expr, scopes) abort
202202
let s:__ = {}
203203
for s:__.scope in a:scopes
204204
for [s:__.name, s:__.value] in items(s:to_scope(s:__.scope))
@@ -214,7 +214,7 @@ function! s:eval(expr, scopes) abort
214214
return 0
215215
endfunction
216216

217-
function! s:to_scope(dict) abort
217+
function s:to_scope(dict) abort
218218
let scope = {}
219219
for [name, Value] in items(a:dict)
220220
if type(Value) == s:f_type
@@ -228,11 +228,11 @@ function! s:to_scope(dict) abort
228228
return scope
229229
endfunction
230230

231-
function! s:to_camel_case(str) abort
231+
function s:to_camel_case(str) abort
232232
return substitute(a:str, '\%(^\|_\)\(\w\)', '\u\1', 'g')
233233
endfunction
234234

235-
function! themis#helper#command#new(runner) abort
235+
function themis#helper#command#new(runner) abort
236236
let events = deepcopy(s:events)
237237
let events.target_bundle = a:runner.get_loading_bundle()
238238
call a:runner.add_event(events)

‎autoload/themis/helper/expect.vim

+10-10
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ let s:expect = {
88
\ }
99
\ }
1010

11-
function! themis#helper#expect#_create_expect(actual) abort
11+
function themis#helper#expect#_create_expect(actual) abort
1212
let expect = deepcopy(s:expect)
1313
let expect._actual = a:actual
1414
let expect.not._actual = a:actual
1515
return expect
1616
endfunction
1717

18-
function! s:matcher_impl(name, f, error_msg, ...) dict abort
18+
function s:matcher_impl(name, f, error_msg, ...) dict abort
1919
let result = call(a:f, [self._actual] + a:000)
2020
if self._negate
2121
let result = !result
@@ -27,25 +27,25 @@ function! s:matcher_impl(name, f, error_msg, ...) dict abort
2727
endif
2828
endfunction
2929

30-
function! s:expr_to_matcher(name, pred, ...) abort
30+
function s:expr_to_matcher(name, pred, ...) abort
3131
let func_name = 's:_matcher_' . a:name
3232
execute join([
33-
\ 'function! ' . func_name . '(...)',
33+
\ 'function ' . func_name . '(...)',
3434
\ ' return ' . a:pred,
3535
\ 'endfunction'], "\n")
3636
return function(func_name)
3737
endfunction
3838

39-
function! s:expr_to_failure_message(name, pred, ...) abort
39+
function s:expr_to_failure_message(name, pred, ...) abort
4040
let func_name = 's:_failure_message_' . a:name
4141
execute join([
42-
\ 'function! ' . func_name . '(not, name, ...)',
42+
\ 'function ' . func_name . '(not, name, ...)',
4343
\ ' return ' . a:pred,
4444
\ 'endfunction'], "\n")
4545
return function(func_name)
4646
endfunction
4747

48-
function! s:default_failure_message(not, name, ...) abort
48+
function s:default_failure_message(not, name, ...) abort
4949
return printf('Expected %s %s%s%s.',
5050
\ string(a:1),
5151
\ (a:not ? 'not ' : ''),
@@ -55,7 +55,7 @@ endfunction
5555

5656
let s:matchers = {}
5757
let s:failure_messages = {}
58-
function! themis#helper#expect#define_matcher(name, predicate, ...) abort
58+
function themis#helper#expect#define_matcher(name, predicate, ...) abort
5959
if type(a:predicate) ==# type('')
6060
let s:matchers[a:name] = s:expr_to_matcher(a:name, a:predicate)
6161
elseif type(a:predicate) ==# type(function('function'))
@@ -71,7 +71,7 @@ function! themis#helper#expect#define_matcher(name, predicate, ...) abort
7171
let s:failure_messages[a:name] = function('s:default_failure_message')
7272
endif
7373
execute join([
74-
\ 'function! s:expect.' . a:name . '(...)',
74+
\ 'function s:expect.' . a:name . '(...)',
7575
\ ' return call("s:matcher_impl", ['. string(a:name) . ', s:matchers.' . a:name . ', s:failure_messages.' . a:name . '] + a:000, self)',
7676
\ 'endfunction'], "\n")
7777
let s:expect.not[a:name] = s:expect[a:name]
@@ -100,7 +100,7 @@ call themis#helper#expect#define_matcher('to_be_list', 'type(a:1) ==# type([])')
100100
call themis#helper#expect#define_matcher('to_be_dict', 'type(a:1) ==# type({})')
101101
call themis#helper#expect#define_matcher('to_be_float', 'type(a:1) ==# type(0.0)')
102102

103-
function! themis#helper#expect#new(_) abort
103+
function themis#helper#expect#new(_) abort
104104
return function('themis#helper#expect#_create_expect')
105105
endfunction
106106

‎autoload/themis/helper/scope.vim

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ let s:Local = g:themis#vital.import('Vim.ScriptLocal')
99

1010
let s:helper = {}
1111

12-
function! s:helper.funcs(path) abort
12+
function s:helper.funcs(path) abort
1313
return s:Local.sfuncs(a:path)
1414
endfunction
1515

16-
function! s:helper.vars(path) abort
16+
function s:helper.vars(path) abort
1717
return s:Local.svars(a:path)
1818
endfunction
1919

20-
function! themis#helper#scope#new(runner) abort
20+
function themis#helper#scope#new(runner) abort
2121
return deepcopy(s:helper)
2222
endfunction
2323

‎autoload/themis/module.vim

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
let s:save_cpo = &cpo
66
set cpo&vim
77

8-
function! themis#module#exists(type, name) abort
8+
function themis#module#exists(type, name) abort
99
let path = printf('autoload/themis/%s/%s.vim', a:type, a:name)
1010
return globpath(&runtimepath, path, 1) !=# ''
1111
endfunction
1212

13-
function! themis#module#list(type) abort
13+
function themis#module#list(type) abort
1414
let pat = 'autoload/themis/' . a:type . '/*.vim'
1515
return themis#util#sortuniq(map(split(globpath(&runtimepath, pat, 1), "\n"),
1616
\ 'fnamemodify(v:val, ":t:r")'))
1717
endfunction
1818

19-
function! themis#module#load(type, name, args) abort
19+
function themis#module#load(type, name, args) abort
2020
try
2121
let module = call(printf('themis#%s#%s#new', a:type, a:name), a:args)
2222
" XXX: It may perform two or more times.
@@ -30,15 +30,15 @@ function! themis#module#load(type, name, args) abort
3030
endtry
3131
endfunction
3232

33-
function! themis#module#style(name) abort
33+
function themis#module#style(name) abort
3434
return themis#module#load('style', a:name, [])
3535
endfunction
3636

37-
function! themis#module#reporter(name) abort
37+
function themis#module#reporter(name) abort
3838
return themis#module#load('reporter', a:name, [])
3939
endfunction
4040

41-
function! themis#module#supporter(name, runner) abort
41+
function themis#module#supporter(name, runner) abort
4242
return themis#module#load('supporter', a:name, [a:runner])
4343
endfunction
4444

‎autoload/themis/option.vim

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ let s:default_options = {
1414
\ 'exclude': [],
1515
\ }
1616

17-
function! themis#option#default() abort
17+
function themis#option#default() abort
1818
return deepcopy(s:default_options)
1919
endfunction
2020

21-
function! themis#option#empty_options() abort
21+
function themis#option#empty_options() abort
2222
let options = deepcopy(s:default_options)
2323
let list_t = type([])
2424
call filter(options, 'type(v:val) == list_t')
2525
call map(options, '[]')
2626
return options
2727
endfunction
2828

29-
function! themis#option#merge(base, overwriter) abort
29+
function themis#option#merge(base, overwriter) abort
3030
let merged = copy(a:base)
3131
for [name, value] in items(a:overwriter)
3232
if type(value) == type([]) && has_key(merged, name)

‎autoload/themis/report.vim

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@ let s:Report = {
1010
\ 'exceptions': [],
1111
\ }
1212

13-
function! s:Report.is_success() abort
13+
function s:Report.is_success() abort
1414
return self.result ==# 'pass'
1515
endfunction
1616

17-
function! s:Report.get_full_title() abort
17+
function s:Report.get_full_title() abort
1818
return self.bundle.get_test_full_title(self.entry)
1919
endfunction
2020

21-
function! s:Report.get_title() abort
21+
function s:Report.get_title() abort
2222
return self.bundle.get_test_title(self.entry)
2323
endfunction
2424

25-
function! s:Report.get_message() abort
25+
function s:Report.get_message() abort
2626
return join(map(copy(self.exceptions), 'v:val.message'), "\n---\n")
2727
endfunction
2828

29-
function! s:Report.add_exception(exception, throwpoint) abort
29+
function s:Report.add_exception(exception, throwpoint) abort
3030
let callstack = themis#util#callstacklines(a:throwpoint, -1)
3131
if a:exception =~? '^themis:\_s*report:'
3232
let result = matchstr(a:exception, '\c^themis:\_s*report:\_s*\zs.*')
@@ -51,7 +51,7 @@ function! s:Report.add_exception(exception, throwpoint) abort
5151
endif
5252
endfunction
5353

54-
function! themis#report#new(bundle, entry) abort
54+
function themis#report#new(bundle, entry) abort
5555
let report = deepcopy(s:Report)
5656
let report.bundle = a:bundle
5757
let report.entry = a:entry

‎autoload/themis/reporter/dot.vim

+9-9
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,27 @@ set cpo&vim
77

88
let s:reporter = {}
99

10-
function! s:reporter.init(runner, root_bundle) abort
10+
function s:reporter.init(runner, root_bundle) abort
1111
let self.stats = a:runner.supporter('stats')
1212
let self.pending_list = []
1313
let self.failure_list = []
1414
endfunction
1515

16-
function! s:reporter.pass(report) abort
16+
function s:reporter.pass(report) abort
1717
call themis#logn('.')
1818
endfunction
1919

20-
function! s:reporter.fail(report) abort
20+
function s:reporter.fail(report) abort
2121
let self.failure_list += [a:report]
2222
call themis#logn('F')
2323
endfunction
2424

25-
function! s:reporter.pending(report) abort
25+
function s:reporter.pending(report) abort
2626
let self.pending_list += [a:report]
2727
call themis#logn('P')
2828
endfunction
2929

30-
function! s:reporter.end(runner) abort
30+
function s:reporter.end(runner) abort
3131
call themis#log("\n")
3232

3333
call s:print_reports('Pending', self.pending_list)
@@ -36,7 +36,7 @@ function! s:reporter.end(runner) abort
3636
call themis#log(self.stats.stat())
3737
endfunction
3838

39-
function! s:reporter.error(phase, info) abort
39+
function s:reporter.error(phase, info) abort
4040
call themis#log('')
4141
call themis#log(printf('Error occurred in %s.', a:phase))
4242
if has_key(a:info, 'stacktrace')
@@ -45,7 +45,7 @@ function! s:reporter.error(phase, info) abort
4545
call themis#log(a:info.exception)
4646
endfunction
4747

48-
function! s:print_reports(title, reports) abort
48+
function s:print_reports(title, reports) abort
4949
if empty(a:reports)
5050
return
5151
endif
@@ -58,12 +58,12 @@ function! s:print_reports(title, reports) abort
5858
endfor
5959
endfunction
6060

61-
function! s:print_report(n, report) abort
61+
function s:print_report(n, report) abort
6262
call themis#log(printf('%3d) %s', a:n, a:report.get_full_title()))
6363
call themis#log(map(split(a:report.get_message(), "\n"), '" " . v:val'))
6464
endfunction
6565

66-
function! themis#reporter#dot#new() abort
66+
function themis#reporter#dot#new() abort
6767
return deepcopy(s:reporter)
6868
endfunction
6969

‎autoload/themis/reporter/spec.vim

+11-11
Original file line numberDiff line numberDiff line change
@@ -17,65 +17,65 @@ endif
1717

1818
let s:reporter = {}
1919

20-
function! s:reporter.init(runner, root_bundle) abort
20+
function s:reporter.init(runner, root_bundle) abort
2121
let self.stats = a:runner.supporter('stats')
2222
let self.indent = 0
2323
endfunction
2424

25-
function! s:reporter.start(runner) abort
25+
function s:reporter.start(runner) abort
2626
endfunction
2727

28-
function! s:reporter.before_suite(bundle) abort
28+
function s:reporter.before_suite(bundle) abort
2929
let title = a:bundle.get_title()
3030
if title !=# ''
3131
call self.print(title)
3232
let self.indent += 1
3333
endif
3434
endfunction
3535

36-
function! s:reporter.after_suite(bundle) abort
36+
function s:reporter.after_suite(bundle) abort
3737
let title = a:bundle.get_title()
3838
if title !=# ''
3939
let self.indent -= 1
4040
endif
4141
endfunction
4242

43-
function! s:reporter.pass(report) abort
43+
function s:reporter.pass(report) abort
4444
call self.print(printf('[%s] %s', s:pass_symbol, a:report.get_title()))
4545
endfunction
4646

47-
function! s:reporter.fail(report) abort
47+
function s:reporter.fail(report) abort
4848
call self.print(printf('[%s] %s', s:fail_symbol, a:report.get_title()))
4949
call self.print(a:report.get_message(), ' ')
5050
endfunction
5151

52-
function! s:reporter.pending(report) abort
52+
function s:reporter.pending(report) abort
5353
call self.print(printf('[-] %s', a:report.get_title()))
5454
call self.print(a:report.get_message(), ' ')
5555
endfunction
5656

57-
function! s:reporter.error(phase, info) abort
57+
function s:reporter.error(phase, info) abort
5858
call themis#log(printf('Error occurred in %s.', a:phase))
5959
if has_key(a:info, 'stacktrace')
6060
call themis#log(themis#util#error_info(a:info.stacktrace))
6161
endif
6262
call themis#log(a:info.exception)
6363
endfunction
6464

65-
function! s:reporter.end(runner) abort
65+
function s:reporter.end(runner) abort
6666
call themis#log('')
6767
call self.print(self.stats.stat())
6868
endfunction
6969

7070

71-
function! s:reporter.print(message, ...) abort
71+
function s:reporter.print(message, ...) abort
7272
let prefix = a:0 ? a:1 : ''
7373
for line in split(a:message, "\n")
7474
call themis#log(prefix . repeat(' ', self.indent) . line)
7575
endfor
7676
endfunction
7777

78-
function! themis#reporter#spec#new() abort
78+
function themis#reporter#spec#new() abort
7979
return deepcopy(s:reporter)
8080
endfunction
8181

‎autoload/themis/reporter/tap.vim

+9-9
Original file line numberDiff line numberDiff line change
@@ -7,57 +7,57 @@ set cpo&vim
77

88
let s:reporter = {}
99

10-
function! s:reporter.init(runner, root_bundle) abort
10+
function s:reporter.init(runner, root_bundle) abort
1111
let self.stats = a:runner.supporter('stats')
1212
let self.root_bundle = a:root_bundle
1313
endfunction
1414

15-
function! s:reporter.start(runner) abort
15+
function s:reporter.start(runner) abort
1616
call themis#log('1..' . self.root_bundle.total_test_count())
1717
endfunction
1818

19-
function! s:reporter.pass(report) abort
19+
function s:reporter.pass(report) abort
2020
let title = a:report.get_full_title()
2121
let mes = printf('ok %d - %s', self.stats.count(), title)
2222
call themis#log(mes)
2323
endfunction
2424

25-
function! s:reporter.fail(report) abort
25+
function s:reporter.fail(report) abort
2626
let title = a:report.get_full_title()
2727
let mes = printf('not ok %d - %s', self.stats.count(), title)
2828
call themis#log(mes)
2929
call s:print_message(a:report.get_message())
3030
endfunction
3131

32-
function! s:reporter.pending(report) abort
32+
function s:reporter.pending(report) abort
3333
let title = a:report.get_full_title()
3434
let mes = printf('ok %d - %s # SKIP', self.stats.count(), title)
3535
call themis#log(mes)
3636
call s:print_message(a:report.get_message())
3737
endfunction
3838

39-
function! s:reporter.error(phase, info) abort
39+
function s:reporter.error(phase, info) abort
4040
call themis#log(printf('Bail out! Error occurred in %s.', a:phase))
4141
if has_key(a:info, 'stacktrace')
4242
call s:print_message(themis#util#error_info(a:info.stacktrace))
4343
endif
4444
call s:print_message(a:info.exception)
4545
endfunction
4646

47-
function! s:reporter.end(runner) abort
47+
function s:reporter.end(runner) abort
4848
call themis#log('')
4949
call s:print_message(self.stats.stat())
5050
endfunction
5151

5252

53-
function! s:print_message(message) abort
53+
function s:print_message(message) abort
5454
let lines = type(a:message) == type([]) ? a:message : split(a:message, "\n")
5555
for line in lines
5656
call themis#log('# ' . line)
5757
endfor
5858
endfunction
5959

60-
function! themis#reporter#tap#new() abort
60+
function themis#reporter#tap#new() abort
6161
return deepcopy(s:reporter)
6262
endfunction
6363

‎autoload/themis/runner.vim

+25-25
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set cpo&vim
77

88
let s:Runner = {}
99

10-
function! s:Runner.init() abort
10+
function s:Runner.init() abort
1111
let self._emitter = themis#emitter#new()
1212
let self._supporters = {}
1313
let self._styles = {}
@@ -20,7 +20,7 @@ function! s:Runner.init() abort
2020
call self.add_event(style_event)
2121
endfunction
2222

23-
function! s:Runner.start(paths, options) abort
23+
function s:Runner.start(paths, options) abort
2424
try
2525
let save_runtimepath = &runtimepath
2626

@@ -52,19 +52,19 @@ function! s:Runner.start(paths, options) abort
5252
endtry
5353
endfunction
5454

55-
function! s:Runner.get_loading_bundle() abort
55+
function s:Runner.get_loading_bundle() abort
5656
let bundle = get(self, '_loading_bundle', 0)
5757
if bundle is# 0
5858
throw 'themis: Does not ready the base bundle.'
5959
endif
6060
return bundle
6161
endfunction
6262

63-
function! s:Runner.set_loading_bundle(bundle) abort
63+
function s:Runner.set_loading_bundle(bundle) abort
6464
let self._loading_bundle = a:bundle
6565
endfunction
6666

67-
function! s:Runner.get_target_files(paths, options) abort
67+
function s:Runner.get_target_files(paths, options) abort
6868
let files = s:paths2files(a:paths, a:options.recursive)
6969

7070
let exclude_options = filter(copy(a:options.exclude), '!empty(v:val)')
@@ -75,7 +75,7 @@ function! s:Runner.get_target_files(paths, options) abort
7575
return files
7676
endfunction
7777

78-
function! s:Runner.load_bundle_from_files(files, bundle) abort
78+
function s:Runner.load_bundle_from_files(files, bundle) abort
7979
let files_with_styles = {}
8080
for file in a:files
8181
let style = s:can_handle(values(self._styles), file)
@@ -98,7 +98,7 @@ function! s:Runner.load_bundle_from_files(files, bundle) abort
9898
return a:bundle
9999
endfunction
100100

101-
function! s:Runner.load_scripts(files_with_styles, target_bundle) abort
101+
function s:Runner.load_scripts(files_with_styles, target_bundle) abort
102102
for [filename, style_name] in items(a:files_with_styles)
103103
if !filereadable(filename)
104104
throw printf('themis: Target file was not found: %s', filename)
@@ -111,7 +111,7 @@ function! s:Runner.load_scripts(files_with_styles, target_bundle) abort
111111
endfor
112112
endfunction
113113

114-
function! s:Runner.run(bundle) abort
114+
function s:Runner.run(bundle) abort
115115
let stats = self.supporter('stats')
116116
call self.supporter('builtin_assert')
117117
call self.emit('init', self, a:bundle)
@@ -128,13 +128,13 @@ function! s:Runner.run(bundle) abort
128128
return error_count
129129
endfunction
130130

131-
function! s:Runner.run_all(bundle) abort
131+
function s:Runner.run_all(bundle) abort
132132
call self.emit('start', self)
133133
call self.run_bundle(a:bundle)
134134
call self.emit('end', self)
135135
endfunction
136136

137-
function! s:Runner.run_bundle(bundle) abort
137+
function s:Runner.run_bundle(bundle) abort
138138
if a:bundle.is_empty()
139139
return
140140
endif
@@ -146,14 +146,14 @@ function! s:Runner.run_bundle(bundle) abort
146146
call self.emit('after_suite', a:bundle)
147147
endfunction
148148

149-
function! s:Runner.run_suite(bundle, test_entries) abort
149+
function s:Runner.run_suite(bundle, test_entries) abort
150150
for entry in a:test_entries
151151
call self.emit('start_test', a:bundle, entry)
152152
call self.run_test(a:bundle, entry)
153153
endfor
154154
endfunction
155155

156-
function! s:Runner.run_test(bundle, test_entry) abort
156+
function s:Runner.run_test(bundle, test_entry) abort
157157
let report = themis#report#new(a:bundle, a:test_entry)
158158
try
159159
call self.emit_before_test(a:bundle, a:test_entry)
@@ -173,14 +173,14 @@ endfunction
173173

174174
" FIXME: a:bundle may not have a:test_entry.
175175
" Should I pass the original bundle?
176-
function! s:Runner.emit_before_test(bundle, test_entry) abort
176+
function s:Runner.emit_before_test(bundle, test_entry) abort
177177
if has_key(a:bundle, 'parent')
178178
call self.emit_before_test(a:bundle.parent, a:test_entry)
179179
endif
180180
call self.emit('before_test', a:bundle, a:test_entry)
181181
endfunction
182182

183-
function! s:Runner.emit_after_test(bundle, test_entry, report) abort
183+
function s:Runner.emit_after_test(bundle, test_entry, report) abort
184184
try
185185
call self.emit('after_test', a:bundle, a:test_entry)
186186
catch
@@ -191,22 +191,22 @@ function! s:Runner.emit_after_test(bundle, test_entry, report) abort
191191
endif
192192
endfunction
193193

194-
function! s:Runner.supporter(name) abort
194+
function s:Runner.supporter(name) abort
195195
if !has_key(self._supporters, a:name)
196196
let self._supporters[a:name] = themis#module#supporter(a:name, self)
197197
endif
198198
return self._supporters[a:name]
199199
endfunction
200200

201-
function! s:Runner.add_event(listener) abort
201+
function s:Runner.add_event(listener) abort
202202
call self._emitter.add_listener(a:listener)
203203
endfunction
204204

205-
function! s:Runner.emit(name, ...) abort
205+
function s:Runner.emit(name, ...) abort
206206
call call(self._emitter.emit, [a:name] + a:000, self._emitter)
207207
endfunction
208208

209-
function! s:Runner.on_error(phase, exception, throwpoint) abort
209+
function s:Runner.on_error(phase, exception, throwpoint) abort
210210
let phase = self._emitter.emitting()
211211
if phase ==# ''
212212
let phase = a:phase
@@ -225,7 +225,7 @@ function! s:Runner.on_error(phase, exception, throwpoint) abort
225225
endfunction
226226

227227
let s:style_event = {}
228-
function! s:style_event._(event, args) abort
228+
function s:style_event._(event, args) abort
229229
if themis#bundle#is_bundle(get(a:args, 0))
230230
let bundle = a:args[0]
231231
let style = bundle.get_style()
@@ -241,7 +241,7 @@ function! s:style_event._(event, args) abort
241241
endif
242242
endfunction
243243

244-
function! s:append_rtp(path) abort
244+
function s:append_rtp(path) abort
245245
let appended = []
246246
if isdirectory(a:path)
247247
let path = substitute(a:path, '\\\+', '/', 'g')
@@ -257,14 +257,14 @@ function! s:append_rtp(path) abort
257257
return appended
258258
endfunction
259259

260-
function! s:load_themisrc(paths) abort
260+
function s:load_themisrc(paths) abort
261261
let themisrcs = themis#util#find_files(a:paths, '.themisrc')
262262
for themisrc in themisrcs
263263
execute 'source' fnameescape(themisrc)
264264
endfor
265265
endfunction
266266

267-
function! s:load_plugins(runtimepaths) abort
267+
function s:load_plugins(runtimepaths) abort
268268
let appended = [getcwd()]
269269
if !empty(a:runtimepaths)
270270
for rtp in a:runtimepaths
@@ -278,7 +278,7 @@ function! s:load_plugins(runtimepaths) abort
278278
endfor
279279
endfunction
280280

281-
function! s:paths2files(paths, recursive) abort
281+
function s:paths2files(paths, recursive) abort
282282
let files = []
283283
let target_pattern = a:recursive ? '**/*' : '*'
284284
for path in a:paths
@@ -292,7 +292,7 @@ function! s:paths2files(paths, recursive) abort
292292
return filter(map(files, 'fnamemodify(v:val, mods)'), '!isdirectory(v:val)')
293293
endfunction
294294

295-
function! s:can_handle(styles, file) abort
295+
function s:can_handle(styles, file) abort
296296
for style in a:styles
297297
if style.can_handle(a:file)
298298
return style.name
@@ -301,7 +301,7 @@ function! s:can_handle(styles, file) abort
301301
return ''
302302
endfunction
303303

304-
function! themis#runner#new() abort
304+
function themis#runner#new() abort
305305
let runner = deepcopy(s:Runner)
306306
call runner.init()
307307
return runner

‎autoload/themis/style/basic.vim

+12-12
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ let s:describe_pattern = '^__.\+__$'
1616

1717
let s:event = {}
1818

19-
function! s:load_nested_bundle(bundle, runner) abort
19+
function s:load_nested_bundle(bundle, runner) abort
2020
call a:runner.set_loading_bundle(a:bundle)
2121
let suite = copy(a:bundle.suite)
2222
call filter(suite, 'v:key =~# s:describe_pattern')
@@ -31,25 +31,25 @@ function! s:load_nested_bundle(bundle, runner) abort
3131
endfor
3232
endfunction
3333

34-
function! s:event.before_suite(bundle) abort
34+
function s:event.before_suite(bundle) abort
3535
if has_key(a:bundle.suite, 'before')
3636
call a:bundle.suite.before()
3737
endif
3838
endfunction
3939

40-
function! s:event.before_test(bundle, entry) abort
40+
function s:event.before_test(bundle, entry) abort
4141
if has_key(a:bundle.suite, 'before_each')
4242
call a:bundle.suite.before_each()
4343
endif
4444
endfunction
4545

46-
function! s:event.after_suite(bundle) abort
46+
function s:event.after_suite(bundle) abort
4747
if has_key(a:bundle.suite, 'after')
4848
call a:bundle.suite.after()
4949
endif
5050
endfunction
5151

52-
function! s:event.after_test(bundle, entry) abort
52+
function s:event.after_test(bundle, entry) abort
5353
if has_key(a:bundle.suite, 'after_each')
5454
call a:bundle.suite.after_each()
5555
endif
@@ -60,41 +60,41 @@ let s:style = {
6060
\ 'event': s:event,
6161
\ }
6262

63-
function! s:style.get_test_names(bundle) abort
63+
function s:style.get_test_names(bundle) abort
6464
let suite = copy(a:bundle.suite)
6565
call filter(suite, 'type(v:val) == s:func_t')
6666
call filter(suite, 'index(s:special_names, v:key) < 0')
6767
call filter(suite, 'v:key !~# s:describe_pattern')
6868
return s:names_by_defined_order(suite)
6969
endfunction
7070

71-
function! s:names_by_defined_order(suite) abort
71+
function s:names_by_defined_order(suite) abort
7272
let s:suite_for_sort = a:suite
7373
let result = sort(keys(a:suite), 's:test_compare')
7474
unlet s:suite_for_sort
7575
return result
7676
endfunction
7777

78-
function! s:test_compare(a, b) abort
78+
function s:test_compare(a, b) abort
7979
let a_order = s:to_i(themis#util#funcname(s:suite_for_sort[a:a]))
8080
let b_order = s:to_i(themis#util#funcname(s:suite_for_sort[a:b]))
8181
return a_order ==# b_order ? 0 : b_order < a_order ? 1 : -1
8282
endfunction
8383

84-
function! s:to_i(value) abort
84+
function s:to_i(value) abort
8585
return a:value =~# '^\d\+$' ? str2nr(a:value) : a:value
8686
endfunction
8787

88-
function! s:style.can_handle(filename) abort
88+
function s:style.can_handle(filename) abort
8989
return fnamemodify(a:filename, ':e') ==? 'vim'
9090
endfunction
9191

92-
function! s:style.load_script(filename, runner) abort
92+
function s:style.load_script(filename, runner) abort
9393
source `=a:filename`
9494
call s:load_nested_bundle(a:runner.get_loading_bundle(), a:runner)
9595
endfunction
9696

97-
function! themis#style#basic#new() abort
97+
function themis#style#basic#new() abort
9898
return deepcopy(s:style)
9999
endfunction
100100

‎autoload/themis/style/vimspec.vim

+27-27
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set cpo&vim
77

88
let s:func_t = type(function('type'))
99

10-
function! s:parse_describe(tokens, lnum, context_stack, scope_id) abort
10+
function s:parse_describe(tokens, lnum, context_stack, scope_id) abort
1111
let [command, description] = a:tokens[1 : 2]
1212
if description ==# ''
1313
throw printf('vimspec:%d::%s must take an argument', a:lnum, command)
@@ -23,16 +23,16 @@ function! s:parse_describe(tokens, lnum, context_stack, scope_id) abort
2323
let funcname = printf('s:themis_vimspec_scope_%d', a:scope_id)
2424
call add(a:context_stack, ['describe', a:lnum, funcname, a:scope_id])
2525
return [
26-
\ printf('function! %s() abort', funcname),
26+
\ printf('function %s() abort', funcname),
2727
\ printf('let s:themis_vimspec_bundles += [%s]', bundle_new),
2828
\ 'let s:themis_vimspec_bundles[-1]._vimspec_hooks = {}',
29-
\ 'function! s:themis_vimspec_bundles[-1]._vimspec_hooks.start_test()',
29+
\ 'function s:themis_vimspec_bundles[-1]._vimspec_hooks.start_test()',
3030
\ printf(' call s:themis_vimspec_scopes.tmp_scope(%d)', a:scope_id),
3131
\ 'endfunction',
3232
\ ]
3333
endfunction
3434

35-
function! s:parse_example(tokens, lnum, context_stack, func_id) abort
35+
function s:parse_example(tokens, lnum, context_stack, func_id) abort
3636
let [command, example] = a:tokens[1 : 2]
3737
if example ==# ''
3838
throw printf('vimspec:%d::%s must take an argument', a:lnum, command)
@@ -48,14 +48,14 @@ function! s:parse_example(tokens, lnum, context_stack, func_id) abort
4848
return [
4949
\ printf('let %s[-1].suite_descriptions["T_%05d"] = %s',
5050
\ bundle_var, a:func_id, string(example)),
51-
\ printf('function! %s[-1].suite.T_%05d() abort',
51+
\ printf('function %s[-1].suite.T_%05d() abort',
5252
\ bundle_var, a:func_id),
5353
\ printf('execute %s.extend("%s.scope(%d)", 0)',
5454
\ scope_var, scope_var, scope_id),
5555
\ ]
5656
endfunction
5757

58-
function! s:parse_hook(tokens, lnum, context_stack) abort
58+
function s:parse_hook(tokens, lnum, context_stack) abort
5959
let [command, timing] = a:tokens[1 : 2]
6060
if empty(a:context_stack) || a:context_stack[-1][0] !=# 'describe'
6161
throw printf('vimspec:%d::%s must put on :describe or :context block',
@@ -76,14 +76,14 @@ function! s:parse_hook(tokens, lnum, context_stack) abort
7676
let bundle_var = 's:themis_vimspec_bundles'
7777
let scope_var = 's:themis_vimspec_scopes'
7878
return [
79-
\ printf('function! %s[-1]._vimspec_hooks.%s() abort',
79+
\ printf('function %s[-1]._vimspec_hooks.%s() abort',
8080
\ bundle_var, hook_point),
8181
\ printf('execute %s.extend("%s.scope(%d)", %d)',
8282
\ scope_var, scope_var, scope_id, copy),
8383
\ ]
8484
endfunction
8585

86-
function! s:parse_end(tokens, lnum, context_stack) abort
86+
function s:parse_end(tokens, lnum, context_stack) abort
8787
if empty(a:context_stack)
8888
let command = a:tokens[1]
8989
throw printf('vimspec:%d:There is :%s, but not opened', a:lnum, command)
@@ -117,7 +117,7 @@ function! s:parse_end(tokens, lnum, context_stack) abort
117117
return []
118118
endfunction
119119

120-
function! s:translate_script(lines) abort
120+
function s:translate_script(lines) abort
121121
let result = [
122122
\ 'let s:themis_vimspec_bundles = []',
123123
\ 'let s:themis_vimspec_scopes = themis#style#vimspec#new_scope()',
@@ -170,7 +170,7 @@ function! s:translate_script(lines) abort
170170
return result
171171
endfunction
172172

173-
function! s:compile_specfile(specfile_path, result_path) abort
173+
function s:compile_specfile(specfile_path, result_path) abort
174174
let slines = readfile(a:specfile_path)
175175
let rlines = s:translate_script(slines)
176176
call writefile(rlines, a:result_path)
@@ -179,15 +179,15 @@ endfunction
179179

180180
let s:ScopeKeeper = {'scopes': {}}
181181

182-
function! s:ScopeKeeper.push(scope, scope_id, parent) abort
182+
function s:ScopeKeeper.push(scope, scope_id, parent) abort
183183
let self.scopes[a:scope_id] = {'scope': a:scope, 'parent': a:parent}
184184
endfunction
185185

186-
function! s:ScopeKeeper.tmp_scope(from) abort
186+
function s:ScopeKeeper.tmp_scope(from) abort
187187
call self.push(copy(self.scope(a:from)), 0, -1)
188188
endfunction
189189

190-
function! s:ScopeKeeper.back(scope_id, back_scope) abort
190+
function s:ScopeKeeper.back(scope_id, back_scope) abort
191191
let scope = self.scopes[a:scope_id].scope
192192
for [k, Val] in items(a:back_scope)
193193
if k !=# 'self'
@@ -197,7 +197,7 @@ function! s:ScopeKeeper.back(scope_id, back_scope) abort
197197
endfor
198198
endfunction
199199

200-
function! s:ScopeKeeper.scope(scope_id) abort
200+
function s:ScopeKeeper.scope(scope_id) abort
201201
let all = {}
202202
let scope_id = a:scope_id
203203
while has_key(self.scopes, scope_id)
@@ -210,7 +210,7 @@ function! s:ScopeKeeper.scope(scope_id) abort
210210
return all
211211
endfunction
212212

213-
function! s:ScopeKeeper.extend(val, copy) abort
213+
function s:ScopeKeeper.extend(val, copy) abort
214214
let val = a:copy ? printf('copy(%s)', a:val) : a:val
215215
return join([
216216
\ printf('for [s:__key, s:__val] in items(%s)', val),
@@ -220,7 +220,7 @@ function! s:ScopeKeeper.extend(val, copy) abort
220220
\ ], "\n")
221221
endfunction
222222

223-
function! themis#style#vimspec#new_scope() abort
223+
function themis#style#vimspec#new_scope() abort
224224
return deepcopy(s:ScopeKeeper)
225225
endfunction
226226

@@ -229,35 +229,35 @@ let s:event = {
229229
\ '_converted_files': []
230230
\ }
231231

232-
function! s:event.start_test(bundle, entry) abort
232+
function s:event.start_test(bundle, entry) abort
233233
call s:call_hook(a:bundle, 'start_test')
234234
endfunction
235235

236-
function! s:event.before_suite(bundle) abort
236+
function s:event.before_suite(bundle) abort
237237
call s:call_hook(a:bundle, 'before_all')
238238
endfunction
239239

240-
function! s:event.before_test(bundle, entry) abort
240+
function s:event.before_test(bundle, entry) abort
241241
call s:call_hook(a:bundle, 'before_each')
242242
endfunction
243243

244-
function! s:event.after_test(bundle, entry) abort
244+
function s:event.after_test(bundle, entry) abort
245245
call s:call_hook(a:bundle, 'after_each')
246246
endfunction
247247

248-
function! s:event.after_suite(bundle) abort
248+
function s:event.after_suite(bundle) abort
249249
call s:call_hook(a:bundle, 'after_all')
250250
endfunction
251251

252-
function! s:event.finish(runner) abort
252+
function s:event.finish(runner) abort
253253
for file in self._converted_files
254254
if filereadable(file)
255255
call delete(file)
256256
endif
257257
endfor
258258
endfunction
259259

260-
function! s:call_hook(bundle, point) abort
260+
function s:call_hook(bundle, point) abort
261261
if has_key(get(a:bundle, '_vimspec_hooks', {}), a:point)
262262
call call(a:bundle._vimspec_hooks[a:point], [], a:bundle.suite)
263263
endif
@@ -268,16 +268,16 @@ let s:style = {
268268
\ 'event': s:event,
269269
\ }
270270

271-
function! s:style.get_test_names(bundle) abort
271+
function s:style.get_test_names(bundle) abort
272272
let expr = 'type(a:bundle.suite[v:val]) == s:func_t'
273273
return sort(filter(keys(a:bundle.suite), expr))
274274
endfunction
275275

276-
function! s:style.can_handle(filename) abort
276+
function s:style.can_handle(filename) abort
277277
return fnamemodify(a:filename, ':e') ==? 'vimspec'
278278
endfunction
279279

280-
function! s:style.load_script(filename, runner) abort
280+
function s:style.load_script(filename, runner) abort
281281
let compiled_specfile_path = tempname()
282282
call add(self.event._converted_files, compiled_specfile_path)
283283
try
@@ -293,7 +293,7 @@ function! s:style.load_script(filename, runner) abort
293293
endtry
294294
endfunction
295295

296-
function! themis#style#vimspec#new() abort
296+
function themis#style#vimspec#new() abort
297297
return deepcopy(s:style)
298298
endfunction
299299

‎autoload/themis/supporter/builtin_assert.vim

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ set cpoptions&vim
77

88
let s:receiver = {}
99

10-
function! s:receiver.start_test(bundle, entry) abort
10+
function s:receiver.start_test(bundle, entry) abort
1111
if exists('v:errors')
1212
let v:errors = []
1313
endif
1414
endfunction
1515

16-
function! s:receiver.end_test(report) abort
16+
function s:receiver.end_test(report) abort
1717
if !exists('v:errors')
1818
return
1919
endif
@@ -24,11 +24,11 @@ function! s:receiver.end_test(report) abort
2424
let v:errors = []
2525
endfunction
2626

27-
function! s:parse_error(error) abort
27+
function s:parse_error(error) abort
2828
let matched = matchlist(a:error, '\v^(.{-}) line (\d+):\s*(.+)$')
2929
endfunction
3030

31-
function! themis#supporter#builtin_assert#new(runner) abort
31+
function themis#supporter#builtin_assert#new(runner) abort
3232
call a:runner.add_event(deepcopy(s:receiver))
3333
return {}
3434
endfunction

‎autoload/themis/supporter/stats.vim

+10-10
Original file line numberDiff line numberDiff line change
@@ -15,40 +15,40 @@ let s:receiver = {
1515
let s:supporter = {'receiver': s:receiver}
1616

1717

18-
function! s:receiver.start_test(bundle, title) abort
18+
function s:receiver.start_test(bundle, title) abort
1919
let self._count += 1
2020
endfunction
2121

22-
function! s:receiver.pass(report) abort
22+
function s:receiver.pass(report) abort
2323
let self._passes += 1
2424
endfunction
2525

26-
function! s:receiver.fail(report) abort
26+
function s:receiver.fail(report) abort
2727
let self._failures += 1
2828
endfunction
2929

30-
function! s:receiver.pending(report) abort
30+
function s:receiver.pending(report) abort
3131
let self._pendings += 1
3232
endfunction
3333

3434

35-
function! s:supporter.count() abort
35+
function s:supporter.count() abort
3636
return self.receiver._count
3737
endfunction
3838

39-
function! s:supporter.pass() abort
39+
function s:supporter.pass() abort
4040
return self.receiver._passes
4141
endfunction
4242

43-
function! s:supporter.fail() abort
43+
function s:supporter.fail() abort
4444
return self.receiver._failures
4545
endfunction
4646

47-
function! s:supporter.pending() abort
47+
function s:supporter.pending() abort
4848
return self.receiver._pendings
4949
endfunction
5050

51-
function! s:supporter.stat() abort
51+
function s:supporter.stat() abort
5252
let result = ['tests ' . self.count(), 'passes ' . self.pass()]
5353

5454
let pending = self.pending()
@@ -64,7 +64,7 @@ function! s:supporter.stat() abort
6464
return join(result, "\n")
6565
endfunction
6666

67-
function! themis#supporter#stats#new(runner) abort
67+
function themis#supporter#stats#new(runner) abort
6868
let supporter = deepcopy(s:supporter)
6969
call a:runner.add_event(supporter.receiver)
7070
return supporter

‎autoload/themis/util.vim

+20-20
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ let s:StackInfo = {
1515
\ 'filled': 0,
1616
\ }
1717

18-
function! s:StackInfo.fill_info() abort
18+
function s:StackInfo.fill_info() abort
1919
if self.filled
2020
return
2121
endif
@@ -35,7 +35,7 @@ function! s:StackInfo.fill_info() abort
3535
let self.filled = 1
3636
endfunction
3737

38-
function! s:StackInfo.make_signature() abort
38+
function s:StackInfo.make_signature() abort
3939
let funcname = get(s:func_aliases, self.funcname, self.funcname)
4040
let args = join(self.arguments, ', ')
4141
let flags = ''
@@ -54,7 +54,7 @@ function! s:StackInfo.make_signature() abort
5454
return printf('function %s(%s)%s', funcname, args, flags)
5555
endfunction
5656

57-
function! s:StackInfo.format() abort
57+
function s:StackInfo.format() abort
5858
call self.fill_info()
5959
if !self.exists
6060
return printf('function %s() This function is already deleted.',
@@ -77,7 +77,7 @@ function! s:StackInfo.format() abort
7777
return 'Unknown Stack'
7878
endfunction
7979

80-
function! s:StackInfo.get_line(...) abort
80+
function s:StackInfo.get_line(...) abort
8181
let lnum = a:0 ? a:1 : self.line
8282
call self.fill_info()
8383
if self.type ==# 'file'
@@ -98,26 +98,26 @@ function! s:StackInfo.get_line(...) abort
9898
return ''
9999
endfunction
100100

101-
function! s:StackInfo.adjusted_lnum(...) abort
101+
function s:StackInfo.adjusted_lnum(...) abort
102102
let lnum = a:0 ? a:1 : self.line
103103
let adjuster = get(s:line_adjuster, self.funcname, 0)
104104
return lnum + adjuster
105105
endfunction
106106

107-
function! s:StackInfo.adjusted_abs_lnum(...) abort
107+
function s:StackInfo.adjusted_abs_lnum(...) abort
108108
let lnum = a:0 ? a:1 : self.line
109109
let deflnum = self.defline
110110
let adjuster = get(s:line_adjuster, self.funcname, 0)
111111
return lnum + deflnum + adjuster
112112
endfunction
113113

114-
function! s:StackInfo.get_line_with_lnum(...) abort
114+
function s:StackInfo.get_line_with_lnum(...) abort
115115
let lnum = a:0 ? a:1 : self.line
116116
let line = self.get_line(lnum)
117117
return printf('%3d: %s', self.adjusted_lnum(lnum), line)
118118
endfunction
119119

120-
function! themis#util#stack_info(stack) abort
120+
function themis#util#stack_info(stack) abort
121121
let info = deepcopy(s:StackInfo)
122122
let info.stack = a:stack
123123

@@ -136,7 +136,7 @@ function! themis#util#stack_info(stack) abort
136136
return info
137137
endfunction
138138

139-
function! themis#util#func_alias(dict, prefixes) abort
139+
function themis#util#func_alias(dict, prefixes) abort
140140
let dict_t = type({})
141141
let func_t = type(function('type'))
142142
for [key, Value] in items(a:dict)
@@ -151,7 +151,7 @@ function! themis#util#func_alias(dict, prefixes) abort
151151
endfor
152152
endfunction
153153

154-
function! themis#util#adjust_func_line(target, line) abort
154+
function themis#util#adjust_func_line(target, line) abort
155155
let t = type(a:target)
156156
if t == type({})
157157
for V in values(a:target)
@@ -166,12 +166,12 @@ function! themis#util#adjust_func_line(target, line) abort
166166
endif
167167
endfunction
168168

169-
function! themis#util#callstacklines(throwpoint, ...) abort
169+
function themis#util#callstacklines(throwpoint, ...) abort
170170
let infos = call('themis#util#callstack', [a:throwpoint] + a:000)
171171
return map(infos, 'v:val.format()')
172172
endfunction
173173

174-
function! themis#util#callstack(throwpoint, ...) abort
174+
function themis#util#callstack(throwpoint, ...) abort
175175
let this_stacks = themis#util#parse_callstack(expand('<sfile>'))[: -2]
176176
let throwpoint_stacks = themis#util#parse_callstack(a:throwpoint)
177177
let start = a:0 ? len(this_stacks) + a:1 : 0
@@ -182,13 +182,13 @@ function! themis#util#callstack(throwpoint, ...) abort
182182
return throwpoint_stacks[start :]
183183
endfunction
184184

185-
function! themis#util#parse_callstack(callstack) abort
185+
function themis#util#parse_callstack(callstack) abort
186186
let callstack_line = matchstr(a:callstack, '^\%(function\s\+\)\?\zs.*')
187187
let stack_infos = split(callstack_line, '\.\.')
188188
return map(stack_infos, 'themis#util#stack_info(v:val)')
189189
endfunction
190190

191-
function! themis#util#funcdata(func) abort
191+
function themis#util#funcdata(func) abort
192192
let func = type(a:func) == type(function('type')) ?
193193
\ themis#util#funcname(a:func) : a:func
194194
if func =~# '^\d\+'
@@ -235,7 +235,7 @@ function! themis#util#funcdata(func) abort
235235
\ }
236236
endfunction
237237

238-
function! themis#util#error_info(stacktrace) abort
238+
function themis#util#error_info(stacktrace) abort
239239
let tracelines = map(copy(a:stacktrace), 'v:val.format()')
240240
let tail = a:stacktrace[-1]
241241
if tail.line
@@ -244,11 +244,11 @@ function! themis#util#error_info(stacktrace) abort
244244
return join(tracelines, "\n")
245245
endfunction
246246

247-
function! themis#util#is_funcname(name) abort
247+
function themis#util#is_funcname(name) abort
248248
return a:name =~# '\v^%(%(\<lambda\>)?\d+|%(\u|g:\u|s:|\<SNR\>\d+_)\w+|\h\w*%(#\w+)+)$'
249249
endfunction
250250

251-
function! themis#util#funcname(funcref) abort
251+
function themis#util#funcname(funcref) abort
252252
if has('patch-7.4.1608')
253253
" From Vim 7.4.1608, the result of string() with Partial
254254
" (a kind of Funcref) contains {arglist} and {self} as follows
@@ -264,7 +264,7 @@ function! themis#util#funcname(funcref) abort
264264
return matchstr(str, '^function(''\zs[^'']\{-}\ze''')
265265
endfunction
266266

267-
function! themis#util#get_full_title(obj, ...) abort
267+
function themis#util#get_full_title(obj, ...) abort
268268
let obj = a:obj
269269
let titles = a:0 ? a:1 : []
270270
call insert(titles, obj.get_title())
@@ -275,7 +275,7 @@ function! themis#util#get_full_title(obj, ...) abort
275275
return join(filter(titles, 'v:val !=# ""'), ' ')
276276
endfunction
277277

278-
function! themis#util#sortuniq(list) abort
278+
function themis#util#sortuniq(list) abort
279279
call sort(a:list)
280280
let i = len(a:list) - 1
281281
while 0 < i
@@ -287,7 +287,7 @@ function! themis#util#sortuniq(list) abort
287287
return a:list
288288
endfunction
289289

290-
function! themis#util#find_files(paths, filename) abort
290+
function themis#util#find_files(paths, filename) abort
291291
let todir = 'isdirectory(v:val) ? v:val : fnamemodify(v:val, ":h")'
292292
let dirs = map(copy(a:paths), todir)
293293
let mod = ':p:gs?\\\+?/?:s?/$??'

‎doc/themis.txt

+12-12
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,14 @@ Test is a Vim script like the following.
7474
let s:assert = themis#helper('assert')
7575
7676
" The function name(my_test_1) will be a test name.
77-
function! s:suite.my_test_1()
77+
function s:suite.my_test_1()
7878
call s:assert.equals(3, 1 + 2)
7979
endfunction
8080
81-
function! s:suite.my_test_2()
81+
function s:suite.my_test_2()
8282
call s:assert.equals(8, 2 * 4)
8383
endfunction
84-
function! s:suite.my_fail_test()
84+
function s:suite.my_fail_test()
8585
call s:assert.fail('this will fail')
8686
endfunction
8787
<
@@ -169,7 +169,7 @@ themis#func_alias({dict}) *themis#func_alias()*
169169
For example:
170170
>
171171
let s:MyClass = {}
172-
function! s:MyClass.useful_function()
172+
function s:MyClass.useful_function()
173173
throw 'some error!'
174174
endfunction
175175
call themis#func_alias({'MyClass': s:MyClass})
@@ -284,7 +284,7 @@ You can put helpers in global scope, and use all test scripts.
284284
<
285285
You can define helper functions or commands used only in this project.
286286
>
287-
function! InitBuffer()
287+
function InitBuffer()
288288
tabonly!
289289
only!
290290
enew!
@@ -320,7 +320,7 @@ And write a test. There is a sample with explanation comment.
320320
" Define a function to suite.
321321
" This function is a test.
322322
" Function name becomes a title of test. In this case, "my_test".
323-
function! s:suite.my_test_1()
323+
function s:suite.my_test_1()
324324
" Check the calculation result
325325
let value = 1 + 2
326326
call s:assert.equals(value, 3)
@@ -449,9 +449,9 @@ Some test names have a special meaning. They are called in special situation.
449449
- This is called before the all test.
450450
- You can make nested suite in this function. >
451451
let s:parent = themis#suite('parent')
452-
function! s:parent.__child__()
452+
function s:parent.__child__()
453453
let child = themis#suite('child')
454-
function! child.test()
454+
function child.test()
455455
" Test code here...
456456
endfunction
457457
endfunction
@@ -760,7 +760,7 @@ command.prefix({prefix}) *themis-helper-command-prefix()*
760760
>
761761
call themis#helper('command').prefix('Themis')
762762
763-
function! s:suite.test()
763+
function s:suite.test()
764764
ThemisAssert 1 + 1 == 2
765765
endfunction
766766
<
@@ -774,7 +774,7 @@ command.with({scope}) *themis-helper-command-with()*
774774
let s:assert = themis#helper('assert')
775775
call themis#helper('command').with(s:)
776776
777-
function! s:suite.test()
777+
function s:suite.test()
778778
Assert assert.equals(1 + 1, 2)
779779
endfunction
780780
<
@@ -783,7 +783,7 @@ command.with({scope}) *themis-helper-command-with()*
783783
let s:assert = themis#helper('assert')
784784
call themis#helper('command').with(s:assert)
785785
786-
function! s:suite.test()
786+
function s:suite.test()
787787
Assert Equals(1 + 1, 2)
788788
Assert HasKey({'foo': 0}, 'foo')
789789
endfunction
@@ -930,7 +930,7 @@ themis#helper#expect#define_matcher({name}, {predicate} [, {meesageexpr}])
930930
by specifying {messageexpr}.
931931
If {messageexpr} is |Funcref|, it should have the following signature.
932932
>
933-
function! MyMessage(not, name, x, y)
933+
function MyMessage(not, name, x, y)
934934
let name = (a:not ? 'not ' : '') . a:name
935935
return printf("You tested '%s' with %s and %s but failed",
936936
\ name, a:x, a:y)

‎ftplugin/vimspec/foldexpr.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if exists('*GetVimspecFold')
1212
finish
1313
endif
1414

15-
function! GetVimspecFold(lnum) abort
15+
function GetVimspecFold(lnum) abort
1616
let line = getline(a:lnum)
1717
if line =~# s:pattern_folds
1818
return 'a1'

‎indent/vimspec.vim

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if exists('*GetVimspecIndent')
1717
finish
1818
endif
1919

20-
function! GetVimspecIndent() abort
20+
function GetVimspecIndent() abort
2121
try
2222
" Old Vim's indent plugin has a bug that uses =~
2323
let ignorecase_save = &ignorecase
@@ -40,11 +40,11 @@ function! GetVimspecIndent() abort
4040
endfunction
4141

4242
if exists('*shiftwidth')
43-
function! s:shiftwidth() abort
43+
function s:shiftwidth() abort
4444
return shiftwidth()
4545
endfunction
4646
else
47-
function! s:shiftwidth() abort
47+
function s:shiftwidth() abort
4848
return &l:shiftwidth == 0 ? &l:tabstop : &l:shiftwidth
4949
endfunction
5050
endif

‎macros/themis_startup.vim

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
let s:themis_home = expand('<sfile>:h:h')
66

7-
function! s:append_rtp(path) abort
7+
function s:append_rtp(path) abort
88
if isdirectory(a:path)
99
let path = substitute(a:path, '\\\+', '/', 'g')
1010
let path = substitute(path, '/$', '', 'g')
@@ -16,7 +16,7 @@ function! s:append_rtp(path) abort
1616
endif
1717
endfunction
1818

19-
function! s:start() abort
19+
function s:start() abort
2020
let g:themis#cmdline = 1
2121
call s:append_rtp(s:themis_home)
2222
let args = argv()
@@ -33,7 +33,7 @@ function! s:start() abort
3333
return themis#command#start(args)
3434
endfunction
3535

36-
function! s:dump_error(throwpoint, exception) abort
36+
function s:dump_error(throwpoint, exception) abort
3737
new
3838
try
3939
if $THEMIS_DEBUG == 1 || a:exception =~# '^Vim'
@@ -55,7 +55,7 @@ function! s:dump_error(throwpoint, exception) abort
5555
endtry
5656
endfunction
5757

58-
function! s:main() abort
58+
function s:main() abort
5959
" This :visual is needed for 2 purpose.
6060
" 1. To Start test in Normal mode.
6161
" 2. Exit code is set to 1, whenever it ends Vim from Ex mode after an error

‎test/.themisrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ call themis#option('exclude', ['test/fixture/'])
33

44
call themis#helper('command').with(themis#helper('assert'))
55

6-
function! NewBasicSuite(name, runner) abort
6+
function NewBasicSuite(name, runner) abort
77
let bundle = themis#bundle#new(a:name)
88
let bundle.style = a:runner._styles['basic']
99
return bundle

‎test/bundle.vimspec

+6-6
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ Describe Bundle
6565
Describe test entries
6666
Before
6767
let base.style = themis#module#style('basic')
68-
function! base.suite.test1() abort
68+
function base.suite.test1() abort
6969
endfunction
70-
function! base.suite.test2() abort
70+
function base.suite.test2() abort
7171
endfunction
7272
End
7373

@@ -84,9 +84,9 @@ Describe Bundle
8484
Context with nested bundles
8585
Before
8686
let child = themis#bundle#new('child', base)
87-
function! child.suite.test3() abort
87+
function child.suite.test3() abort
8888
endfunction
89-
function! child.suite.test4() abort
89+
function child.suite.test4() abort
9090
endfunction
9191
End
9292

@@ -120,9 +120,9 @@ Describe Bundle
120120
Describe test entry
121121
Before
122122
let suite = base.suite
123-
function! suite.test1() abort
123+
function suite.test1() abort
124124
endfunction
125-
function! suite.test2() abort
125+
function suite.test2() abort
126126
endfunction
127127
let base.suite_descriptions = {'test1': 'a description for test 1'}
128128
End

‎test/emitter.vimspec

+7-7
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Describe Emitter
4242
Context with a listener which has "foo" event
4343
Before
4444
let listener = {'called': 0}
45-
function! listener.foo(value) abort
45+
function listener.foo(value) abort
4646
let self.called = 1
4747
let self.value = a:value
4848
endfunction
@@ -72,13 +72,13 @@ Describe Emitter
7272
Context with two or more listeners
7373
Before
7474
let listener1 = {'called': 0}
75-
function! listener1.foo() abort
75+
function listener1.foo() abort
7676
let self.called = 1
7777
endfunction
7878
call emitter.add_listener(listener1)
7979

8080
let listener2 = {'called': 0}
81-
function! listener2.foo() abort
81+
function listener2.foo() abort
8282
let self.called = 1
8383
endfunction
8484
call emitter.add_listener(listener2)
@@ -94,7 +94,7 @@ Describe Emitter
9494
Context with a listener which has wildcard event
9595
Before
9696
let listener = {'called': {}}
97-
function! listener._(event, args) abort
97+
function listener._(event, args) abort
9898
let self.called[a:event] = 1
9999
endfunction
100100
call emitter.add_listener(listener)
@@ -109,7 +109,7 @@ Describe Emitter
109109

110110
Context and has "foo" event
111111
Before
112-
function! listener.foo() abort
112+
function listener.foo() abort
113113
endfunction
114114
End
115115
It doesn't receive the defined event
@@ -125,7 +125,7 @@ Describe Emitter
125125
Context when event is emitting
126126
Before
127127
let listener = {'emitter': emitter}
128-
function! listener.foo() abort
128+
function listener.foo() abort
129129
let self.emitting = self.emitter.emitting()
130130
endfunction
131131
call emitter.add_listener(listener)
@@ -147,7 +147,7 @@ Describe Emitter
147147
Context when an error occurred while emitting
148148
Before
149149
let listener = {}
150-
function! listener.foo() abort
150+
function listener.foo() abort
151151
throw 'error'
152152
endfunction
153153
call emitter.add_listener(listener)

‎test/fixture/scope.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function! s:hello(name) abort
1+
function s:hello(name) abort
22
return 'Hello, ' . a:name
33
endfunction
44

‎test/helper/assert.vimspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,7 @@ Describe helper-assert
852852

853853
End
854854

855-
function! s:check_throw(target, args, ...) abort
855+
function s:check_throw(target, args, ...) abort
856856
let expected_exception = a:0 ? a:1 : '^themis:\s*report:\s*failure:.*$'
857857
let not_thrown = 0
858858
try

‎test/helper/command.vim

+28-28
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ let s:helper = themis#suite('helper')
22
let s:assert = themis#helper('assert')
33
call themis#helper('command').prefix('Themis').with(s:assert)
44

5-
function! s:helper.__command__() abort
5+
function s:helper.__command__() abort
66
let command = themis#suite('command')
77

8-
function! command.__Assert__() abort
8+
function command.__Assert__() abort
99
let Assert = themis#suite(':Assert')
10-
function! Assert.check_the_argument_is_truthy() abort
10+
function Assert.check_the_argument_is_truthy() abort
1111
ThemisAssert 1
1212
ThemisAssert '1'
1313
endfunction
14-
function! Assert.can_use_double_quote_in_argument() abort
14+
function Assert.can_use_double_quote_in_argument() abort
1515
ThemisAssert "1"
1616
endfunction
17-
function! Assert.throw_a_report_when_the_argument_is_not_truthy() abort
17+
function Assert.throw_a_report_when_the_argument_is_not_truthy() abort
1818
let template = join([
1919
\ '^themis: report: failure: The truthy value was expected, but it was not the case.',
2020
\ 'Error occurred line:',
@@ -27,93 +27,93 @@ function! s:helper.__command__() abort
2727
call s:check_throw('ThemisAssert', [string([])], printf(template, string([])))
2828
call s:check_throw('ThemisAssert', [0.0], printf(template, string(0.0)))
2929
endfunction
30-
function! Assert.can_access_to_function_local_scope() abort
30+
function Assert.can_access_to_function_local_scope() abort
3131
let x = 10
3232
ThemisAssert x == 10
3333
endfunction
34-
function! Assert.can_access_to_with_scope() abort
34+
function Assert.can_access_to_with_scope() abort
3535
let x = 10
3636
ThemisAssert Equals(x, 10)
3737
ThemisAssert HasKey({'foo': 0}, 'foo')
3838
endfunction
3939
endfunction
4040

41-
function! command.__Throws__() abort
41+
function command.__Throws__() abort
4242
let Throws = themis#suite(':Throws')
43-
function! Throws.detect_exception_in_expr() abort
43+
function Throws.detect_exception_in_expr() abort
4444
Throws ThrowError('error')
4545
endfunction
46-
function! Throws.detect_exception_in_command() abort
46+
function Throws.detect_exception_in_command() abort
4747
Throws :throw 'error'
4848
endfunction
49-
function! Throws.can_check_exception() abort
49+
function Throws.can_check_exception() abort
5050
Throws /^error$/ ThrowError('error')
5151
call s:check_throw('Throws', ['/^error$/ ThrowError("hoge")'], 'An exception was expected, but not thrown')
5252
endfunction
53-
function! Throws.can_use_double_quote_in_argument() abort
53+
function Throws.can_use_double_quote_in_argument() abort
5454
Throws /^error$/ ThrowError("error")
5555
Throws /^error$/ :throw "error"
5656
endfunction
5757
endfunction
5858

59-
function! command.__Fail__() abort
59+
function command.__Fail__() abort
6060
let Fail = themis#suite(':Fail')
61-
function! Fail.fails_a_test_with_message() abort
61+
function Fail.fails_a_test_with_message() abort
6262
call s:check_throw('Fail', ['fail message'], 'failure:\s*fail message$')
6363
endfunction
64-
function! Fail.can_not_omit_message() abort
64+
function Fail.can_not_omit_message() abort
6565
call s:check_throw('Fail', [], '{message} of :Fail can not be empty.')
6666
endfunction
6767
endfunction
6868

69-
function! command.__TODO__() abort
69+
function command.__TODO__() abort
7070
let TODO = themis#suite(':TODO')
71-
function! TODO.fails_a_test_as_todo_with_message() abort
71+
function TODO.fails_a_test_as_todo_with_message() abort
7272
call s:check_throw('TODO', ['fail message'], 'todo:\s*fail message$')
7373
endfunction
74-
function! TODO.uses_default_message_when_the_message_is_omitted() abort
74+
function TODO.uses_default_message_when_the_message_is_omitted() abort
7575
call s:check_throw('TODO', [], 'todo:\s*TODO$')
7676
endfunction
7777
endfunction
7878

79-
function! command.__Skip__() abort
79+
function command.__Skip__() abort
8080
let Skip = themis#suite(':Skip')
81-
function! Skip.fails_a_test_with_message() abort
81+
function Skip.fails_a_test_with_message() abort
8282
call s:check_throw('Skip', ['skip message'], 'SKIP:\s*skip message$')
8383
endfunction
84-
function! Skip.can_not_omit_message() abort
84+
function Skip.can_not_omit_message() abort
8585
call s:check_throw('Skip', [], '{message} of :Skip can not be empty.')
8686
endfunction
8787
endfunction
8888

89-
function! command.__scope__() abort
89+
function command.__scope__() abort
9090
let scope_of_commands = themis#suite('scope of commands')
9191
function scope_of_commands.__scope__() abort
9292
let defined = themis#suite('defined')
93-
function! defined.__scope__() abort
93+
function defined.__scope__() abort
9494
call themis#helper('command').prefix('Defined')
9595
let scope = themis#suite('scope')
96-
function! scope.command_defined() abort
96+
function scope.command_defined() abort
9797
call s:assert.cmd_exists(':DefinedAssert')
9898
endfunction
9999
endfunction
100100

101101
let not_defined = themis#suite('not defined')
102-
function! not_defined.__scope__() abort
102+
function not_defined.__scope__() abort
103103
let scope = themis#suite('scope')
104-
function! scope.command_defined() abort
104+
function scope.command_defined() abort
105105
call s:assert.cmd_not_exists(':DefinedAssert')
106106
endfunction
107107
endfunction
108108
endfunction
109109
endfunction
110110
endfunction
111111

112-
function! ThrowError(err) abort
112+
function ThrowError(err) abort
113113
throw a:err
114114
endfunction
115115

116-
function! s:check_throw(cmd, args, expected_exception) abort
116+
function s:check_throw(cmd, args, expected_exception) abort
117117
let not_thrown = 0
118118
let args = join(map(copy(a:args), 'themis#message(v:val)'), ' ')
119119
try

‎test/helper/expect.vim

+68-68
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
let s:helper = themis#suite('helper')
22
let s:expect = themis#helper('expect')
33

4-
function! s:helper.__expect__() abort
4+
function s:helper.__expect__() abort
55
let expect = themis#suite('expect')
66

7-
function! expect.__to_be_true__() abort
7+
function expect.__to_be_true__() abort
88
let to_be_true = themis#suite('.to_be_true()')
9-
function! to_be_true.checks_value_is_true() abort
9+
function to_be_true.checks_value_is_true() abort
1010
call s:expect(1).to_be_true()
1111
endfunction
12-
function! to_be_true.checks_value_strictly() abort
12+
function to_be_true.checks_value_strictly() abort
1313
call s:check_throw('to_be_true', 100)
1414
call s:check_throw('to_be_true', '1')
1515
call s:check_throw('to_be_true', 1.0)
@@ -18,231 +18,231 @@ function! s:helper.__expect__() abort
1818
endfunction
1919
endfunction
2020

21-
function! expect.__to_be_false__() abort
21+
function expect.__to_be_false__() abort
2222
let to_be_false = themis#suite('.to_be_false()')
23-
function! to_be_false.checks_value_is_false() abort
23+
function to_be_false.checks_value_is_false() abort
2424
call s:expect(0).to_be_false()
2525
endfunction
26-
function! to_be_false.checks_value_strictly() abort
26+
function to_be_false.checks_value_strictly() abort
2727
call s:check_throw('to_be_false', '')
2828
call s:check_throw('to_be_false', 0.0)
2929
call s:check_throw('to_be_false', [])
3030
call s:check_throw('to_be_false', 'to_be_false')
3131
endfunction
3232
endfunction
3333

34-
function! expect.__to_be_truthy__() abort
34+
function expect.__to_be_truthy__() abort
3535
let to_be_truthy = themis#suite('.to_be_truthy()')
36-
function! to_be_truthy.checks_value_is_not_zero() abort
36+
function to_be_truthy.checks_value_is_not_zero() abort
3737
call s:expect(1).to_be_truthy()
3838
call s:expect(100).to_be_truthy()
3939
call s:expect('1').to_be_truthy()
4040
endfunction
41-
function! to_be_truthy.throws_a_report_when_value_is_zero_or_not_a_number() abort
41+
function to_be_truthy.throws_a_report_when_value_is_zero_or_not_a_number() abort
4242
call s:check_throw('to_be_truthy', 0)
4343
call s:check_throw('to_be_truthy', 1.0)
4444
call s:check_throw('to_be_truthy', 'to_be_truthy')
4545
call s:check_throw('to_be_truthy', '0')
4646
endfunction
4747
endfunction
4848

49-
function! expect.__to_equal__() abort
49+
function expect.__to_equal__() abort
5050
let to_equal = themis#suite('.to_equal()')
51-
function! to_equal.checks_values_are_equal() abort
51+
function to_equal.checks_values_are_equal() abort
5252
call s:expect(1).to_equal(1)
5353
call s:expect('foo').to_equal('foo')
5454
call s:expect([1, 2, 3]).to_equal([1, 2, 3])
5555
call s:expect({'foo': 'x'}).to_equal({'foo': 'x'})
5656
endfunction
57-
function! to_equal.throws_a_report_when_values_are_different() abort
57+
function to_equal.throws_a_report_when_values_are_different() abort
5858
call s:check_throw('to_equal', 1, [0])
5959
call s:check_throw('to_equal', 'foo', ['bar'])
6060
call s:check_throw('to_equal', [1, 2, 3], [[1, 2]])
6161
call s:check_throw('to_equal', {'foo': 'x'}, [{'foo': 'y'}])
6262
endfunction
6363
endfunction
6464

65-
function! expect.__to_be_same__() abort
65+
function expect.__to_be_same__() abort
6666
let to_be_same = themis#suite('.to_be_same()')
67-
function! to_be_same.checks_values_have_same_instance() abort
67+
function to_be_same.checks_values_have_same_instance() abort
6868
call s:expect(1).to_be_same(1)
6969
let one_list = [1, 2, 3]
7070
let ref_list = one_list
7171
call s:expect(one_list).to_be_same(ref_list)
7272
endfunction
73-
function! to_be_same.throws_a_report_when_values_are_different_instances() abort
73+
function to_be_same.throws_a_report_when_values_are_different_instances() abort
7474
call s:check_throw('to_be_same', 1, [0])
7575
call s:check_throw('to_be_same', [1, 2, 3], [[1, 2, 3]])
7676
endfunction
7777
endfunction
7878

79-
function! expect.__to_match__() abort
79+
function expect.__to_match__() abort
8080
let to_match = themis#suite('.to_match()')
81-
function! to_match.checks_value_matches_with_regex() abort
81+
function to_match.checks_value_matches_with_regex() abort
8282
call s:expect('foo_bar').to_match('oo')
8383
endfunction
84-
function! to_match.throws_a_report_when_value_is_not_string() abort
84+
function to_match.throws_a_report_when_value_is_not_string() abort
8585
call s:check_throw('to_match', 1, ['x'])
8686
endfunction
87-
function! to_match.throws_a_report_when_value_does_not_match() abort
87+
function to_match.throws_a_report_when_value_does_not_match() abort
8888
call s:check_throw('to_match', 'foo_bar', ['^oo'])
8989
endfunction
9090
endfunction
9191

92-
function! expect.__to_have_length__() abort
92+
function expect.__to_have_length__() abort
9393
let to_have_length = themis#suite('.to_have_length()')
94-
function! to_have_length.checks_length_of_string() abort
94+
function to_have_length.checks_length_of_string() abort
9595
call s:expect('12345').to_have_length(5)
9696
endfunction
97-
function! to_have_length.checks_length_of_list() abort
97+
function to_have_length.checks_length_of_list() abort
9898
call s:expect([1, 2, 3]).to_have_length(3)
9999
endfunction
100-
function! to_have_length.checks_length_of_dict() abort
100+
function to_have_length.checks_length_of_dict() abort
101101
call s:expect({'elem': 1}).to_have_length(1)
102102
endfunction
103-
function! to_have_length.throws_a_report_when_length_is_mismatch() abort
103+
function to_have_length.throws_a_report_when_length_is_mismatch() abort
104104
call s:check_throw('to_have_length', '', [1])
105105
call s:check_throw('to_have_length', [], [1])
106106
call s:check_throw('to_have_length', {}, [1])
107107
endfunction
108-
function! to_have_length.throws_a_report_when_first_argument_is_not_valid() abort
108+
function to_have_length.throws_a_report_when_first_argument_is_not_valid() abort
109109
call s:check_throw('to_have_length', 0, [1])
110110
endfunction
111111
endfunction
112112

113-
function! expect.__have_key__() abort
113+
function expect.__have_key__() abort
114114
let to_have_key = themis#suite('.to_have_key()')
115-
function! to_have_key.checks_key_exists_in_dict() abort
115+
function to_have_key.checks_key_exists_in_dict() abort
116116
call s:expect({'foo': 0}).to_have_key('foo')
117117
endfunction
118-
function! to_have_key.checks_index_exists_in_array() abort
118+
function to_have_key.checks_index_exists_in_array() abort
119119
call s:expect([10, 20, 30]).to_have_key(2)
120120
endfunction
121-
function! to_have_key.throws_a_report_when_key_is_not_exist_in_dict() abort
121+
function to_have_key.throws_a_report_when_key_is_not_exist_in_dict() abort
122122
call s:check_throw('to_have_key', {}, ['foo'])
123123
endfunction
124-
function! to_have_key.throws_a_report_when_index_is_not_exist_in_array() abort
124+
function to_have_key.throws_a_report_when_index_is_not_exist_in_array() abort
125125
call s:check_throw('to_have_key', [], [0])
126126
endfunction
127127
endfunction
128128

129-
function! expect.__to_exist__() abort
129+
function expect.__to_exist__() abort
130130
let to_exist = themis#suite('.to_exist()')
131-
function! to_exist.before() abort
131+
function to_exist.before() abort
132132
let g:existing_variable = 1
133133
endfunction
134-
function! to_exist.after() abort
134+
function to_exist.after() abort
135135
unlet g:existing_variable
136136
endfunction
137-
function! to_exist.checks_existence() abort
137+
function to_exist.checks_existence() abort
138138
call s:expect(':w').to_exist()
139139
call s:expect('*function').to_exist()
140140
call s:expect('g:existing_variable').to_exist()
141141
endfunction
142-
function! to_exist.throws_report_when_the_value_does_not_to_exist() abort
142+
function to_exist.throws_report_when_the_value_does_not_to_exist() abort
143143
call s:check_throw('to_exist', 'g:the_value_which_does_not_exist')
144144
endfunction
145145
endfunction
146146

147-
function! expect.__to_be_empty__() abort
147+
function expect.__to_be_empty__() abort
148148
let to_be_empty = themis#suite('.to_be_empty()')
149-
function! to_be_empty.checks_empty() abort
149+
function to_be_empty.checks_empty() abort
150150
call s:expect([]).to_be_empty()
151151
call s:expect({}).to_be_empty()
152152
call s:expect('').to_be_empty()
153153
endfunction
154-
function! to_be_empty.throws_report_when_the_value_is_not_empty() abort
154+
function to_be_empty.throws_report_when_the_value_is_not_empty() abort
155155
call s:check_throw('to_be_empty', [1, 2, 3])
156156
endfunction
157157
endfunction
158158

159-
function! expect.__comparison__() abort
159+
function expect.__comparison__() abort
160160
let comparison = themis#suite('.to_be_greater_than(_or_equal)/.to_be_less_than(_or_equal)')
161-
function! comparison.checks_value_compared_with_the_other() abort
161+
function comparison.checks_value_compared_with_the_other() abort
162162
call s:expect(1).to_be_greater_than(0)
163163
call s:expect('Z').to_be_greater_than('A')
164164
call s:expect(1).to_be_greater_than_or_equal('1')
165165
call s:expect(0).to_be_less_than(1)
166166
call s:expect('0').to_be_less_than('A')
167167
call s:expect('Z').to_be_less_than_or_equal(0)
168168
endfunction
169-
function! comparison.throws_a_report_when_comparison_result_is_false() abort
169+
function comparison.throws_a_report_when_comparison_result_is_false() abort
170170
call s:check_throw('to_be_greater_than', 0, [1])
171171
call s:check_throw('to_be_less_than', 1, [0])
172172
call s:check_throw('to_be_greater_than_or_equal', 'a', ['z'])
173173
call s:check_throw('to_be_less_than_or_equal', '1', ['0'])
174174
endfunction
175175
endfunction
176176

177-
function! expect.__to_be_number__() abort
177+
function expect.__to_be_number__() abort
178178
let to_be_number = themis#suite('.to_be_number()')
179-
function! to_be_number.checks_type_of_value() abort
179+
function to_be_number.checks_type_of_value() abort
180180
call s:expect(0).to_be_number()
181181
endfunction
182-
function! to_be_number.throws_a_report_when_type_is_mismatch() abort
182+
function to_be_number.throws_a_report_when_type_is_mismatch() abort
183183
call s:check_throw('to_be_number', 0.0)
184184
endfunction
185185
endfunction
186186

187-
function! expect.__to_be_string__() abort
187+
function expect.__to_be_string__() abort
188188
let to_be_string = themis#suite('.to_be_string()')
189-
function! to_be_string.checks_type_of_value() abort
189+
function to_be_string.checks_type_of_value() abort
190190
call s:expect('').to_be_string()
191191
endfunction
192-
function! to_be_string.throws_a_report_when_type_is_mismatch() abort
192+
function to_be_string.throws_a_report_when_type_is_mismatch() abort
193193
call s:check_throw('to_be_string', 0)
194194
endfunction
195195
endfunction
196196

197-
function! expect.__to_be_list__() abort
197+
function expect.__to_be_list__() abort
198198
let to_be_list = themis#suite('.to_be_list()')
199-
function! to_be_list.checks_type_of_value() abort
199+
function to_be_list.checks_type_of_value() abort
200200
call s:expect([]).to_be_list()
201201
endfunction
202-
function! to_be_list.throws_a_report_when_type_is_mismatch() abort
202+
function to_be_list.throws_a_report_when_type_is_mismatch() abort
203203
call s:check_throw('to_be_list', 0)
204204
endfunction
205205
endfunction
206206

207-
function! expect.__to_be_dict__() abort
207+
function expect.__to_be_dict__() abort
208208
let to_be_dict = themis#suite('.to_be_dict()')
209-
function! to_be_dict.checks_type_of_value() abort
209+
function to_be_dict.checks_type_of_value() abort
210210
call s:expect({}).to_be_dict()
211211
endfunction
212-
function! to_be_dict.throws_a_report_when_type_is_mismatch() abort
212+
function to_be_dict.throws_a_report_when_type_is_mismatch() abort
213213
call s:check_throw('to_be_dict', 0)
214214
endfunction
215215
endfunction
216216

217-
function! expect.__to_be_func__() abort
217+
function expect.__to_be_func__() abort
218218
let to_be_func = themis#suite('.to_be_func()')
219-
function! to_be_func.checks_type_of_value() abort
219+
function to_be_func.checks_type_of_value() abort
220220
call s:expect(function('function')).to_be_func()
221221
endfunction
222-
function! to_be_func.throws_a_report_when_type_is_mismatch() abort
222+
function to_be_func.throws_a_report_when_type_is_mismatch() abort
223223
call s:check_throw('to_be_func', 0)
224224
endfunction
225225
endfunction
226226

227-
function! expect.__to_be_float__() abort
227+
function expect.__to_be_float__() abort
228228
let to_be_float = themis#suite('.to_be_float()')
229-
function! to_be_float.checks_type_of_value() abort
229+
function to_be_float.checks_type_of_value() abort
230230
call s:expect(0.0).to_be_float()
231231
endfunction
232-
function! to_be_float.throws_a_report_when_type_is_mismatch() abort
232+
function to_be_float.throws_a_report_when_type_is_mismatch() abort
233233
call s:check_throw('to_be_float', 0)
234234
endfunction
235235
endfunction
236236

237-
function! expect.__custom_matcher__() abort
237+
function expect.__custom_matcher__() abort
238238
let custom_matcher = themis#suite('custom matcher')
239-
function! custom_matcher.before() abort
239+
function custom_matcher.before() abort
240240
call themis#helper#expect#define_matcher('to_be_one_bigger_than', 'a:1 ==# a:2 + 1',
241241
\ '(a:not ? "Not e" : "E") . "xpect " . string(a:1) . " to equal " . string(a:2) . "+1"')
242-
function! AmbigousEqual(a, b) abort
242+
function AmbigousEqual(a, b) abort
243243
return a:a == a:b
244244
endfunction
245-
function! MyFailureMessage(not, name, x, y) abort
245+
function MyFailureMessage(not, name, x, y) abort
246246
if a:not
247247
return 'Not expect ' . string(a:x) . ' == ' . string(a:y)
248248
else
@@ -251,15 +251,15 @@ function! s:helper.__expect__() abort
251251
endfunction
252252
call themis#helper#expect#define_matcher('to_be_similar', function('AmbigousEqual'), function('MyFailureMessage'))
253253
endfunction
254-
function! custom_matcher.after() abort
254+
function custom_matcher.after() abort
255255
delfunction AmbigousEqual
256256
delfunction MyFailureMessage
257257
endfunction
258-
function! custom_matcher.can_be_defined() abort
258+
function custom_matcher.can_be_defined() abort
259259
call s:expect(2).to_be_one_bigger_than(1)
260260
call s:expect('2').to_be_similar(2)
261261
endfunction
262-
function! custom_matcher.provides_failre_message_definition() abort
262+
function custom_matcher.provides_failre_message_definition() abort
263263
call s:check_throw('to_be_one_bigger_than', 2, [0], 0, 'themis: report: failure: Expect 2 to equal 0+1')
264264
call s:check_throw('to_be_one_bigger_than', 2, [1], 1, 'themis: report: failure: Not expect 2 to equal 1+1')
265265
call s:check_throw('to_be_similar', 2, ['1'], 0, 'themis: report: failure: Expect 2 == ''1''')
@@ -269,7 +269,7 @@ function! s:helper.__expect__() abort
269269

270270
endfunction
271271

272-
function! s:check_throw(target, actual, ...) abort
272+
function s:check_throw(target, actual, ...) abort
273273
let args = a:0 ? a:1 : []
274274
let not = a:0 > 1 ? (a:2 ==# 1 ? 1 : 0) : 0
275275
let expected_exception = a:0 > 2 ? a:3 : '^themis:\s*report:\s*failure:.*$'

‎test/report.vimspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Describe Report
22
Before
33
let bundle = themis#bundle#new('base')
4-
function! bundle.suite.test1() abort
4+
function bundle.suite.test1() abort
55
endfunction
66
let report = themis#report#new(bundle, 'test1')
77
End

‎test/runner.vimspec

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Describe Runner
66
Describe events
77
Before
88
let listener = {'called': []}
9-
function! listener._(name, args) abort
9+
function listener._(name, args) abort
1010
let self.called += [a:name]
1111
endfunction
1212
call runner.add_event(listener)
@@ -32,12 +32,12 @@ Describe Runner
3232
Before
3333
let bundle = themis#bundle#new('test')
3434
let bundle.style = runner._styles['basic']
35-
function! bundle.suite.success_test() abort
35+
function bundle.suite.success_test() abort
3636
endfunction
37-
function! bundle.suite.failure_test() abort
37+
function bundle.suite.failure_test() abort
3838
Fail fail test
3939
endfunction
40-
function! bundle.suite.pending_test() abort
40+
function bundle.suite.pending_test() abort
4141
Skip pending
4242
endfunction
4343
End

‎test/style/basic/hook.vim

+21-21
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
let s:hook = themis#suite('hook')
22

3-
function! s:hook.before() abort
3+
function s:hook.before() abort
44
let self.runner = themis#runner#new()
55
endfunction
66

7-
function! s:hook.before_each() abort
7+
function s:hook.before_each() abort
88
let self.bundle = themis#bundle#new('sample')
99
let self.bundle.style = themis#module#style('basic')
1010
let self.suite = self.bundle.suite
1111
let self.suite.called = []
1212
endfunction
1313

14-
function! s:hook.is_called_in_order() abort
15-
function! self.suite.before() abort
14+
function s:hook.is_called_in_order() abort
15+
function self.suite.before() abort
1616
let self.called += ['before']
1717
endfunction
18-
function! self.suite.before_each() abort
18+
function self.suite.before_each() abort
1919
let self.called += ['before_each']
2020
endfunction
21-
function! self.suite.test1() abort
21+
function self.suite.test1() abort
2222
let self.called += ['test1']
2323
endfunction
24-
function! self.suite.test2() abort
24+
function self.suite.test2() abort
2525
let self.called += ['test2']
2626
endfunction
27-
function! self.suite.after_each() abort
27+
function self.suite.after_each() abort
2828
let self.called += ['after_each']
2929
endfunction
30-
function! self.suite.after() abort
30+
function self.suite.after() abort
3131
let self.called += ['after']
3232
endfunction
3333

@@ -47,41 +47,41 @@ function! s:hook.is_called_in_order() abort
4747
\ ])
4848
endfunction
4949

50-
function! s:hook.with_parent_is_called_in_order() abort
51-
function! self.suite.before() abort
50+
function s:hook.with_parent_is_called_in_order() abort
51+
function self.suite.before() abort
5252
let self.called += ['parent_before']
5353
endfunction
54-
function! self.suite.before_each() abort
54+
function self.suite.before_each() abort
5555
let self.called += ['parent_before_each']
5656
endfunction
57-
function! self.suite.parent_test() abort
57+
function self.suite.parent_test() abort
5858
let self.called += ['parent_test']
5959
endfunction
60-
function! self.suite.after_each() abort
60+
function self.suite.after_each() abort
6161
let self.called += ['parent_after_each']
6262
endfunction
63-
function! self.suite.after() abort
63+
function self.suite.after() abort
6464
let self.called += ['parent_after']
6565
endfunction
6666

6767
let child = themis#bundle#new()
6868
let child.suite.called = self.suite.called
69-
function! child.suite.before() abort
69+
function child.suite.before() abort
7070
let self.called += ['child_before']
7171
endfunction
72-
function! child.suite.before_each() abort
72+
function child.suite.before_each() abort
7373
let self.called += ['child_before_each']
7474
endfunction
75-
function! child.suite.parent_test1() abort
75+
function child.suite.parent_test1() abort
7676
let self.called += ['child_test1']
7777
endfunction
78-
function! child.suite.parent_test2() abort
78+
function child.suite.parent_test2() abort
7979
let self.called += ['child_test2']
8080
endfunction
81-
function! child.suite.after_each() abort
81+
function child.suite.after_each() abort
8282
let self.called += ['child_after_each']
8383
endfunction
84-
function! child.suite.after() abort
84+
function child.suite.after() abort
8585
let self.called += ['child_after']
8686
endfunction
8787
call self.bundle.add_child(child)

‎test/style/basic/order.vim

+25-25
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,94 @@
11
let s:order = themis#suite('order')
22

3-
function! s:order.__test__() abort
3+
function s:order.__test__() abort
44
let test = themis#suite('test')
55

6-
function! test.before() abort
6+
function test.before() abort
77
let self.count = 0
88
endfunction
9-
function! test.first() abort
9+
function test.first() abort
1010
let self.count += 1
1111
Assert Equals(self.count, 1)
1212
endfunction
13-
function! test.second() abort
13+
function test.second() abort
1414
let self.count += 1
1515
Assert Equals(self.count, 2)
1616
endfunction
17-
function! test.third() abort
17+
function test.third() abort
1818
let self.count += 1
1919
Assert Equals(self.count, 3)
2020
endfunction
21-
function! test.fourth() abort
21+
function test.fourth() abort
2222
let self.count += 1
2323
Assert Equals(self.count, 4)
2424
endfunction
25-
function! test.fifth() abort
25+
function test.fifth() abort
2626
let self.count += 1
2727
Assert Equals(self.count, 5)
2828
endfunction
29-
function! test.sixth() abort
29+
function test.sixth() abort
3030
let self.count += 1
3131
Assert Equals(self.count, 6)
3232
endfunction
33-
function! test.seventh() abort
33+
function test.seventh() abort
3434
let self.count += 1
3535
Assert Equals(self.count, 7)
3636
endfunction
37-
function! test.eighth() abort
37+
function test.eighth() abort
3838
let self.count += 1
3939
Assert Equals(self.count, 8)
4040
endfunction
41-
function! test.ninth() abort
41+
function test.ninth() abort
4242
let self.count += 1
4343
Assert Equals(self.count, 9)
4444
endfunction
45-
function! test.tenth() abort
45+
function test.tenth() abort
4646
let self.count += 1
4747
Assert Equals(self.count, 10)
4848
endfunction
4949

5050
endfunction
5151

52-
function! s:order.__nested_bundle__() abort
52+
function s:order.__nested_bundle__() abort
5353
let nested_bundle = themis#suite('nested_bundle')
5454

55-
function! nested_bundle.before() abort
55+
function nested_bundle.before() abort
5656
let g:count = 0
5757
endfunction
58-
function! nested_bundle.after() abort
58+
function nested_bundle.after() abort
5959
unlet! g:count
6060
endfunction
61-
function! nested_bundle.__first__() abort
61+
function nested_bundle.__first__() abort
6262
let first = themis#suite('first')
63-
function! first.count() abort
63+
function first.count() abort
6464
let g:count += 1
6565
Assert Equals(g:count, 1)
6666
endfunction
6767
endfunction
68-
function! nested_bundle.__second__() abort
68+
function nested_bundle.__second__() abort
6969
let second = themis#suite('second')
70-
function! second.count() abort
70+
function second.count() abort
7171
let g:count += 1
7272
Assert Equals(g:count, 2)
7373
endfunction
7474
endfunction
75-
function! nested_bundle.__third__() abort
75+
function nested_bundle.__third__() abort
7676
let third = themis#suite('third')
77-
function! third.count() abort
77+
function third.count() abort
7878
let g:count += 1
7979
Assert Equals(g:count, 3)
8080
endfunction
8181
endfunction
82-
function! nested_bundle.__fourth__() abort
82+
function nested_bundle.__fourth__() abort
8383
let fourth = themis#suite('fourth')
84-
function! fourth.count() abort
84+
function fourth.count() abort
8585
let g:count += 1
8686
Assert Equals(g:count, 4)
8787
endfunction
8888
endfunction
89-
function! nested_bundle.__fifth__() abort
89+
function nested_bundle.__fifth__() abort
9090
let fifth = themis#suite('fifth')
91-
function! fifth.count() abort
91+
function fifth.count() abort
9292
let g:count += 1
9393
Assert Equals(g:count, 5)
9494
endfunction

‎test/supporter/builtin_assert.vimspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Describe supporter-builtin_assert
1313
End
1414

1515
It handles assert_true()
16-
function! suite.test_assert_true() abort
16+
function suite.test_assert_true() abort
1717
call assert_true(0)
1818
endfunction
1919
call runner.run(bundle)

‎test/supporter/stats.vimspec

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ Describe supporter-stats
55

66
let bundle = NewBasicSuite('sample', runner)
77
let suite = bundle.suite
8-
function! suite.success1() abort
8+
function suite.success1() abort
99
endfunction
10-
function! suite.success2() abort
10+
function suite.success2() abort
1111
endfunction
12-
function! suite.success3() abort
12+
function suite.success3() abort
1313
endfunction
14-
function! suite.fail1() abort
14+
function suite.fail1() abort
1515
Fail fail test
1616
endfunction
17-
function! suite.fail2() abort
17+
function suite.fail2() abort
1818
throw 'omg'
1919
endfunction
20-
function! suite.pending1() abort
20+
function suite.pending1() abort
2121
Skip pending test
2222
endfunction
2323

‎test/util.vimspec

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
let s:file = expand('<sfile>')
22

3-
function! ExecuteCmd(cmd) abort
3+
function ExecuteCmd(cmd) abort
44
execute a:cmd
55
endfunction
66

7-
function! SampleFunctionForUtil(foo, bar, ...) abort
7+
function SampleFunctionForUtil(foo, bar, ...) abort
88
echo "line1"
99
echo "line2"
1010
echo [
@@ -15,20 +15,20 @@ function! SampleFunctionForUtil(foo, bar, ...) abort
1515
echo "lastline"
1616
endfunction
1717

18-
function! s:is_indication_of_attribute_supported() abort
18+
function s:is_indication_of_attribute_supported() abort
1919
return (v:version == 703 && has('patch1136')) || 703 < v:version
2020
endfunction
2121

2222
if s:is_indication_of_attribute_supported()
23-
function! SampleFunctionWithoutAbort()
23+
function SampleFunctionWithoutAbort()
2424
endfunction
25-
function! SampleFunctionWithDict() dict
25+
function SampleFunctionWithDict() dict
2626
endfunction
27-
function! SampleFunctionWithRange() range
27+
function SampleFunctionWithRange() range
2828
endfunction
2929
if has('lambda')
30-
function! SampleFunctionWithClosureParent()
31-
function! SampleFunctionWithClosure() closure
30+
function SampleFunctionWithClosureParent()
31+
function SampleFunctionWithClosure() closure
3232
endfunction
3333
endfunction
3434
call SampleFunctionWithClosureParent()
@@ -98,7 +98,7 @@ Describe util
9898
End
9999
It takes a anonymous function
100100
let obj = {}
101-
function! obj.func() abort
101+
function obj.func() abort
102102
endfunction
103103
let funcname = matchstr(string(obj.func), '^function(''\zs[^'']\{-}\ze''')
104104
Assert True(themis#util#funcdata(funcname).exists)
@@ -113,7 +113,7 @@ Describe util
113113
End
114114
It returns the data with "exists" flag as false when the function is already deleted
115115
let obj = {}
116-
function! obj.func() abort
116+
function obj.func() abort
117117
endfunction
118118
let funcname = matchstr(string(obj.func), '^function(''\zs[^'']\{-}\ze''')
119119
unlet obj
@@ -213,7 +213,7 @@ Describe util
213213
End
214214
It returns function name of anonymous function
215215
let obj = {}
216-
function! obj.funcname() abort
216+
function obj.funcname() abort
217217
endfunction
218218
Assert Match(themis#util#funcname(obj.funcname), '^\d\+$')
219219
End
@@ -229,25 +229,25 @@ Describe util
229229
Describe #get_full_title()
230230
It returns the full title of a suite or a report
231231
let obj1 = {}
232-
function! obj1.get_title() abort
232+
function obj1.get_title() abort
233233
return 'foo'
234234
endfunction
235235
Assert Equals(themis#util#get_full_title(obj1), 'foo')
236236

237237
let obj2 = {'parent': obj1}
238-
function! obj2.get_title() abort
238+
function obj2.get_title() abort
239239
return 'bar'
240240
endfunction
241241
Assert Equals(themis#util#get_full_title(obj2), 'foo bar')
242242

243243
let obj3 = {'parent': obj2}
244-
function! obj3.get_title() abort
244+
function obj3.get_title() abort
245245
return ''
246246
endfunction
247247
Assert Equals(themis#util#get_full_title(obj3), 'foo bar')
248248

249249
let obj4 = {'parent': obj3}
250-
function! obj4.get_title() abort
250+
function obj4.get_title() abort
251251
return 'buz'
252252
endfunction
253253
Assert Equals(themis#util#get_full_title(obj4), 'foo bar buz')

0 commit comments

Comments
 (0)
Please sign in to comment.