aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_vimscript.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/testdir/test_vimscript.vim')
-rw-r--r--src/nvim/testdir/test_vimscript.vim19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_vimscript.vim b/src/nvim/testdir/test_vimscript.vim
index 3487a028ca..7a75d0e88a 100644
--- a/src/nvim/testdir/test_vimscript.vim
+++ b/src/nvim/testdir/test_vimscript.vim
@@ -1542,6 +1542,9 @@ func Test_delfunction_force()
endfunc
delfunc! Xtest
delfunc! Xtest
+
+ " Try deleting the current function
+ call assert_fails('delfunc Test_delfunction_force', 'E131:')
endfunc
" Test using bang after user command {{{1
@@ -1653,6 +1656,8 @@ func Test_compound_assignment_operators()
call assert_equal(4.2, x)
call assert_fails('let x %= 0.5', 'E734')
call assert_fails('let x .= "f"', 'E734')
+ let x = !3.14
+ call assert_equal(0.0, x)
endif
" Test for environment variable
@@ -1939,6 +1944,20 @@ func Test_sfile_in_function()
delfunc Xfunc
endfunc
+" Test for errors in converting to float from various types {{{1
+func Test_float_conversion_errors()
+ if has('float')
+ call assert_fails('let x = 4.0 % 2.0', 'E804')
+ call assert_fails('echo 1.1[0]', 'E806')
+ call assert_fails('echo sort([function("min"), 1], "f")', 'E891:')
+ call assert_fails('echo 3.2 == "vim"', 'E892:')
+ call assert_fails('echo sort([[], 1], "f")', 'E893:')
+ call assert_fails('echo sort([{}, 1], "f")', 'E894:')
+ call assert_fails('echo 3.2 == v:true', 'E362:')
+ " call assert_fails('echo 3.2 == v:none', 'E907:')
+ endif
+endfunc
+
func Test_for_over_string()
let res = ''
for c in 'aéc̀d'