-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathgopher_test.vim
39 lines (29 loc) · 1013 Bytes
/
gopher_test.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
scriptencoding utf-8
call gopher#init#config()
fun! Test_error() abort
mess clear
call gopher#error('string')
call gopher#error('%d %s', 666, 'fmt')
call gopher#error(['list1', 'list2'])
let l:m = split(execute(':messages'), "\n")
let l:out = l:m[0][:20] is# 'Messages maintainer: ' ? l:m[1:] : l:m[0:]
let l:want = ['gopher.vim: string', 'gopher.vim: 666 fmt', 'gopher.vim: list1', 'gopher.vim: list2']
if l:out != l:want
call Errorf("\nwant: %s\nout: %s", l:want, l:out)
endif
mess clear
endfun
fun! Test_info() abort
return
mess clear
call gopher#info('string')
call gopher#error('%d %s', 666, 'fmt')
call gopher#info(['list1', 'list2'])
let l:m = split(execute(':messages'), "\n")
let l:out = l:m[0][:20] is# 'Messages maintainer: ' ? l:m[1:] : l:m[0:]
let l:want = ['gopher.vim: string', 'gopher.vim: 666 fmt', 'gopher.vim: list1', 'gopher.vim: list2']
if l:out != l:want
call Errorf("\nwant: %s\nout: %s", l:want, l:out)
endif
mess clear
endfun