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