changeset 32015:018c77663f66 v9.0.1339

patch 9.0.1339: no test for :disassemble with class function Commit: https://github.com/vim/vim/commit/38f1ab31fa31196360dc4a31aeb388889b8bd6b8 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Feb 21 20:09:46 2023 +0000 patch 9.0.1339: no test for :disassemble with class function Problem: No test for :disassemble with class function. Solution: Add a test.
author Bram Moolenaar <Bram@vim.org>
date Tue, 21 Feb 2023 21:15:03 +0100
parents caf134e4ff5f
children 3eaebd299742
files src/testdir/test_vim9_disassemble.vim src/version.c
diffstat 2 files changed, 42 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/test_vim9_disassemble.vim
+++ b/src/testdir/test_vim9_disassemble.vim
@@ -3006,4 +3006,44 @@ def Test_disassemble_defer()
         instr)
 enddef
 
+def Test_disassemble_class_function()
+  var lines =<< trim END
+      vim9script
+
+      class Cl
+          static def Fc(): string
+            return "x"
+          enddef
+      endclass
+
+      g:instr = execute('disassemble Cl.Fc')
+  END
+  v9.CheckScriptSuccess(lines)
+  assert_match('Fc\_s*' ..
+        'return "x"\_s*' ..
+        '\d PUSHS "x"\_s*' ..
+        '\d RETURN\_s*',
+        g:instr)
+
+  lines =<< trim END
+      vim9script
+
+      class Cl
+          def Fo(): string
+            return "y"
+          enddef
+      endclass
+
+      g:instr = execute('disassemble Cl.Fo')
+  END
+  v9.CheckScriptSuccess(lines)
+  assert_match('Fo\_s*' ..
+        'return "y"\_s*' ..
+        '\d PUSHS "y"\_s*' ..
+        '\d RETURN\_s*',
+        g:instr)
+
+  unlet g:instr
+enddef
+
 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1339,
+/**/
     1338,
 /**/
     1337,