comparison src/testdir/test_vimscript.vim @ 19724:b3e93a05c3ca v8.2.0418

patch 8.2.0418: code in eval.c not sufficiently covered by tests Commit: https://github.com/vim/vim/commit/8b633135106dda8605463b780573c45b00c22afe Author: Bram Moolenaar <Bram@vim.org> Date: Fri Mar 20 18:20:51 2020 +0100 patch 8.2.0418: code in eval.c not sufficiently covered by tests Problem: Code in eval.c not sufficiently covered by tests. Solution: Add more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5815)
author Bram Moolenaar <Bram@vim.org>
date Fri, 20 Mar 2020 18:30:05 +0100
parents da98d2ed8dc5
children 2c4d9ca33769
comparison
equal deleted inserted replaced
19723:16aa117306ec 19724:b3e93a05c3ca
1735 call assert_equal(10.5, x) 1735 call assert_equal(10.5, x)
1736 let x /= 2.5 1736 let x /= 2.5
1737 call assert_equal(4.2, x) 1737 call assert_equal(4.2, x)
1738 call assert_fails('let x %= 0.5', 'E734') 1738 call assert_fails('let x %= 0.5', 'E734')
1739 call assert_fails('let x .= "f"', 'E734') 1739 call assert_fails('let x .= "f"', 'E734')
1740 let x = !3.14
1741 call assert_equal(0.0, x)
1740 endif 1742 endif
1741 1743
1742 " Test for environment variable 1744 " Test for environment variable
1743 let $FOO = 1 1745 let $FOO = 1
1744 call assert_fails('let $FOO += 1', 'E734') 1746 call assert_fails('let $FOO += 1', 'E734')
2081 endfunc 2083 endfunc
2082 call Xfunc() 2084 call Xfunc()
2083 delfunc Xfunc 2085 delfunc Xfunc
2084 endfunc 2086 endfunc
2085 2087
2088 " Test for errors in converting to float from various types {{{1
2089 func Test_float_conversion_errors()
2090 if has('float')
2091 call assert_fails('let x = 4.0 % 2.0', 'E804')
2092 call assert_fails('echo 1.1[0]', 'E806')
2093 call assert_fails('echo sort([function("min"), 1], "f")', 'E891:')
2094 call assert_fails('echo 3.2 == "vim"', 'E892:')
2095 call assert_fails('echo sort([[], 1], "f")', 'E893:')
2096 call assert_fails('echo sort([{}, 1], "f")', 'E894:')
2097 call assert_fails('echo 3.2 == v:true', 'E362:')
2098 call assert_fails('echo 3.2 == v:none', 'E907:')
2099 endif
2100 endfunc
2101
2086 "------------------------------------------------------------------------------- 2102 "-------------------------------------------------------------------------------
2087 " Modelines {{{1 2103 " Modelines {{{1
2088 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker 2104 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker
2089 "------------------------------------------------------------------------------- 2105 "-------------------------------------------------------------------------------