diff src/testdir/test_profile.vim @ 23735:7caffd835aa1 v8.2.2409

patch 8.2.2409: Vim9: profiling only works for one function Commit: https://github.com/vim/vim/commit/e5ea346a07a7750c02a89996b67716b43c767d06 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jan 25 21:01:48 2021 +0100 patch 8.2.2409: Vim9: profiling only works for one function Problem: Vim9: profiling only works for one function. Solution: Select the right instructions when calling and returning. (closes #7743)
author Bram Moolenaar <Bram@vim.org>
date Mon, 25 Jan 2021 21:15:06 +0100
parents f98692ae09a0
children 9b55c60f9d52
line wrap: on
line diff
--- a/src/testdir/test_profile.vim
+++ b/src/testdir/test_profile.vim
@@ -5,6 +5,7 @@ CheckFeature profile
 
 source shared.vim
 source screendump.vim
+source vim9.vim
 
 func Test_profile_func()
   call RunProfileFunc('func', 'let', 'let')
@@ -583,4 +584,21 @@ func Test_profile_typed_func()
   call delete('XtestProfile')
 endfunc
 
+func Test_vim9_profiling()
+  " only tests that compiling and calling functions doesn't crash
+  let lines =<< trim END
+      vim9script
+      def Func()
+        Crash()
+      enddef
+      def Crash()
+      enddef
+      prof start /tmp/profile.log
+      prof func Func
+      Func()
+  END
+  call CheckScriptSuccess(lines)
+endfunc
+
+
 " vim: shiftwidth=2 sts=2 expandtab