1" Test that the methods used for testing work. 2 3func Test_assert_false() 4 call assert_false(0) 5endfunc 6 7func Test_assert_true() 8 call assert_true(1) 9 call assert_true(123) 10endfunc 11 12func Test_assert_equal() 13 let s = 'foo' 14 call assert_equal('foo', s) 15 let n = 4 16 call assert_equal(4, n) 17 let l = [1, 2, 3] 18 call assert_equal([1, 2, 3], l) 19endfunc 20 21func Test_assert_exception() 22 try 23 nocommand 24 catch 25 call assert_exception('E492:') 26 endtry 27 28 try 29 nocommand 30 catch 31 try 32 " illegal argument, get NULL for error 33 call assert_exception([]) 34 catch 35 call assert_exception('E730:') 36 endtry 37 endtry 38endfunc 39 40func Test_wrong_error_type() 41 let save_verrors = v:errors 42 let v:['errors'] = {'foo': 3} 43 call assert_equal('yes', 'no') 44 let verrors = v:errors 45 let v:errors = save_verrors 46 call assert_equal(type([]), type(verrors)) 47endfunc 48 49func Test_user_is_happy() 50 smile 51 sleep 300m 52endfunc 53