-
Notifications
You must be signed in to change notification settings - Fork 0
/
UT-fixtures.vim
57 lines (49 loc) · 1.56 KB
/
UT-fixtures.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
"=============================================================================
" File: tests/lh/UT-fixtures.vim {{{1
" Author: Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
" <URL:http://github.com/LucHermitte/vim-UT>
" Version: 0.0.1
" Created: 11th Feb 2009
" Last Update: $Date$
"------------------------------------------------------------------------
" Description: UnitTests for the UT plugin.
" - Test fixtures
"
"------------------------------------------------------------------------
" Installation: «install details»
" History: «history»
" TODO: «missing features»
" }}}1
"=============================================================================
let s:cpo_save=&cpo
set cpo&vim
"------------------------------------------------------------------------
UTSuite [lh#UT] Testing fixtures
let s:v1 = 0
let s:v2 = 0
function! s:Setup()
Assert! exists('s:v1')
Assert! exists('s:v2')
let s:v1 += 1
let s:v2 += 1
endfunction
function! s:Teardown()
let s:v1 = 0
endfunction
function! s:TestSetup()
Comment "First test weither s:v1 and g:v2 are set to 1"
" Assert0 s:v1 == 1
Assert s:v1 == 1
Assert s:v2 == 1
endfunction
function! s:TestTeardown()
Comment "Second test weither only s:v1 is incremented, while g:v2 is set to 1"
Assert s:v1 == 1
Assert s:v2 == 2
endfunction
" UTPlay TestTeardown
UTIgnore TestTeardown
"------------------------------------------------------------------------
let &cpo=s:cpo_save
"=============================================================================
" vim600: set fdm=marker: