diff src/testdir/test_vim9_func.vim @ 26792:30d8377ea1b1 v8.2.3924

patch 8.2.3924: Vim9: no error if something follows :enddef Commit: https://github.com/vim/vim/commit/7473a84cf935f64ddd4ea7fe7eee0f9c51c50b60 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Dec 28 17:55:26 2021 +0000 patch 8.2.3924: Vim9: no error if something follows :enddef Problem: Vim9: no error if something follows :enddef in a nested function. Solution: Give an error. Move common code to a function.
author Bram Moolenaar <Bram@vim.org>
date Tue, 28 Dec 2021 19:00:05 +0100
parents 83b35c75c21a
children a6ccb6ec581c
line wrap: on
line diff
--- a/src/testdir/test_vim9_func.vim
+++ b/src/testdir/test_vim9_func.vim
@@ -1686,7 +1686,7 @@ def Test_nested_function_with_nextcmd()
       # Compile all functions
       defcompile
   END
-  CheckScriptFailure(lines, 'E476: Invalid command: AAAAA')
+  CheckScriptFailure(lines, 'E1173: Text found after enddef: BBBB')
 enddef
 
 def Test_nested_function_with_args_split()
@@ -1703,8 +1703,17 @@ def Test_nested_function_with_args_split
       # Compile all functions
       defcompile
   END
-  # FIXME: this should fail on the BBBB
-  CheckScriptSuccess(lines)
+  CheckScriptFailure(lines, 'E1173: Text found after enddef: BBBB')
+
+  lines =<< trim END
+      vim9script
+      def FirstFunction()
+        func SecondFunction()
+        endfunc|BBBB
+      enddef
+      defcompile
+  END
+  CheckScriptFailure(lines, 'E1173: Text found after endfunction: BBBB')
 enddef
 
 def Test_return_type_wrong()