-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUT-buf.vim
More file actions
84 lines (72 loc) · 2.2 KB
/
UT-buf.vim
File metadata and controls
84 lines (72 loc) · 2.2 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
"=============================================================================
" File: tests/lh/UT-buf.vim {{{1
" Author: Luc Hermitte <EMAIL:luc {dot} hermitte {at} gmail {dot} com>
" <URL:http://github.com/LucHermitte/vim-UT>
" License: GPLv3 with exceptions
" <URL:http://github.com/LucHermitte/vim-UT/blob/master/License.md>
" Version: 2.0.0.
let s:k_version = '200'
" Created: 06th May 2020
" Last Update: 14th May 2020
"------------------------------------------------------------------------
" Description:
" Unit Test for UT's :SetBufferContent & :AssertBufferMatch
"
"------------------------------------------------------------------------
" History: «history»
" TODO: «missing features»
" }}}1
"=============================================================================
UTSuite [lh#UT] Testing Buffer testing features
" runtime autoload/lh/UT.vim
let s:cpo_save=&cpo
set cpo&vim
"------------------------------------------------------------------------
function! s:BeforeAll() abort
silent! call lh#window#create_window_with('new') " work around possible E36
file toto.test
endfunction
function! s:AfterAll() abort
silent! bw!
endfunction
"------------------------------------------------------------------------
function! s:Test_SetBuffer_EOF()
SetBufferContent << trim EOF
1
2
3
EOF
call lh#UT#assert_buffer_match('', 46, ['1', '2', '', '3'])
endfunction
function! s:Test_SetBuffer_file()
SetBufferContent tests/lh/1-2-3.txt
call lh#UT#assert_buffer_match('', 49, ['1', '2', '3'])
endfunction
function! s:Test_AssertBuffer_EOF()
SetBufferContent << trim EOF
1
2
3
EOF
AssertBufferMatch << trim EOF
1
2
3
EOF
endfunction
function! s:Test_AssertBuffer_file()
SetBufferContent << trim EOF
1
2
3
EOF
AssertBufferMatch tests/lh/1-2-3.txt
endfunction
function! s:Test_AssertBuffer_file_file()
SetBufferContent tests/lh/1-2-3.txt
AssertBufferMatch tests/lh/1-2-3.txt
endfunction
"------------------------------------------------------------------------
let &cpo=s:cpo_save
"=============================================================================
" vim600: set fdm=marker: