]> granicus.if.org Git - vim/commitdiff
patch 8.2.1350: Vim9: no test for error message when redefining function v8.2.1350
authorBram Moolenaar <Bram@vim.org>
Sat, 1 Aug 2020 20:23:20 +0000 (22:23 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 1 Aug 2020 20:23:20 +0000 (22:23 +0200)
Problem:    Vim9: no test for error message when redefining function.
Solution:   Add a test.

src/testdir/test_vim9_script.vim
src/version.c

index 221b38d7a88466fd2b60c81282132642f53ebe00..b96411ff6781c2aa0d4621c8c52978696945e8b8 100644 (file)
@@ -1651,6 +1651,19 @@ def Test_func_overrules_import_fails()
   delete('XexportedFunc.vim')
 enddef
 
+def Test_func_redefine_fails()
+  let lines =<< trim END
+    vim9script
+    def Func()
+      echo 'one'
+    enddef
+    def Func()
+      echo 'two'
+    enddef
+  END
+  CheckScriptFailure(lines, 'E1073:')
+enddef
+
 def Test_fixed_size_list()
   # will be allocated as one piece of memory, check that changes work
   let l = [1, 2, 3, 4]
index c98d2ab76c7773e7dfbaeeecd0a281b05deaf6d4..00d8c2dab6a6c79550367ccc1c85e6415f96831f 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1350,
 /**/
     1349,
 /**/