2015-11-29 17:35:35 +01:00
|
|
|
" Test that the methods used for testing work.
|
|
|
|
|
|
2015-11-30 21:38:24 +01:00
|
|
|
func Test_assert_false()
|
|
|
|
|
call assert_false(0)
|
2015-11-29 17:35:35 +01:00
|
|
|
endfunc
|
|
|
|
|
|
2015-11-30 21:38:24 +01:00
|
|
|
func Test_assert_true()
|
|
|
|
|
call assert_true(1)
|
|
|
|
|
call assert_true(123)
|
2015-11-29 17:35:35 +01:00
|
|
|
endfunc
|
|
|
|
|
|
2015-11-30 21:38:24 +01:00
|
|
|
func Test_assert_equal()
|
2015-11-29 17:35:35 +01:00
|
|
|
let s = 'foo'
|
2015-11-30 21:38:24 +01:00
|
|
|
call assert_equal('foo', s)
|
2015-11-29 17:35:35 +01:00
|
|
|
let n = 4
|
2015-11-30 21:38:24 +01:00
|
|
|
call assert_equal(4, n)
|
2015-11-29 17:35:35 +01:00
|
|
|
let l = [1, 2, 3]
|
2015-11-30 21:38:24 +01:00
|
|
|
call assert_equal([1, 2, 3], l)
|
2015-11-29 17:35:35 +01:00
|
|
|
endfunc
|
2015-12-31 20:46:39 +01:00
|
|
|
|
2016-01-19 14:31:20 +01:00
|
|
|
func Test_assert_exception()
|
|
|
|
|
try
|
|
|
|
|
nocommand
|
|
|
|
|
catch
|
|
|
|
|
call assert_exception('E492:')
|
|
|
|
|
endtry
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
nocommand
|
|
|
|
|
catch
|
|
|
|
|
try
|
|
|
|
|
" illegal argument, get NULL for error
|
|
|
|
|
call assert_exception([])
|
|
|
|
|
catch
|
|
|
|
|
call assert_exception('E730:')
|
|
|
|
|
endtry
|
|
|
|
|
endtry
|
|
|
|
|
endfunc
|
|
|
|
|
|
2015-12-31 20:46:39 +01:00
|
|
|
func Test_user_is_happy()
|
|
|
|
|
smile
|
|
|
|
|
sleep 300m
|
|
|
|
|
endfunc
|