changeset 20913:a127db33a075 v8.2.1008

patch 8.2.1008: Vim9: no test for disassambling newly added instructions Commit: https://github.com/vim/vim/commit/0779fab2979d6d055ba3c464f1c2b9d90dc9e49f Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jun 18 22:18:18 2020 +0200 patch 8.2.1008: Vim9: no test for disassambling newly added instructions Problem: Vim9: no test for disassambling newly added instructions. Solution: Add a function and check disassembly.
author Bram Moolenaar <Bram@vim.org>
date Thu, 18 Jun 2020 22:30:04 +0200
parents 2fb9ec701297
children f62d75f4ba60
files src/testdir/test_vim9_disassemble.vim src/version.c
diffstat 2 files changed, 38 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/test_vim9_disassemble.vim
+++ b/src/testdir/test_vim9_disassemble.vim
@@ -185,6 +185,42 @@ def Test_disassemble_store_member()
         res)
 enddef
 
+def s:ListAssign()
+  let x: string
+  let y: string
+  let l: list<any>
+  [x, y; l] = g:stringlist
+enddef
+
+def Test_disassemble_list_assign()
+  let res = execute('disass s:ListAssign')
+  assert_match('<SNR>\d*_ListAssign\_s*' ..
+        'let x: string\_s*' ..
+        '\d PUSHS "\[NULL\]"\_s*' ..
+        '\d STORE $0\_s*' ..
+        'let y: string\_s*' ..
+        '\d PUSHS "\[NULL\]"\_s*' ..
+        '\d STORE $1\_s*' ..
+        'let l: list<any>\_s*' ..
+        '\d NEWLIST size 0\_s*' ..
+        '\d STORE $2\_s*' ..
+        '\[x, y; l\] = g:stringlist\_s*' ..
+        '\d LOADG g:stringlist\_s*' ..
+        '\d CHECKTYPE list stack\[-1\]\_s*' ..
+        '\d CHECKLEN >= 2\_s*' ..
+        '\d\+ ITEM 0\_s*' ..
+        '\d\+ CHECKTYPE string stack\[-1\]\_s*' ..
+        '\d\+ STORE $0\_s*' ..
+        '\d\+ ITEM 1\_s*' ..
+        '\d\+ CHECKTYPE string stack\[-1\]\_s*' ..
+        '\d\+ STORE $1\_s*' ..
+        '\d\+ SLICE 2\_s*' ..
+        '\d\+ STORE $2\_s*' ..
+        '\d\+ PUSHNR 0\_s*' ..
+        '\d\+ RETURN',
+        res)
+enddef
+
 def s:ScriptFuncUnlet()
   g:somevar = "value"
   unlet g:somevar
--- a/src/version.c
+++ b/src/version.c
@@ -755,6 +755,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1008,
+/**/
     1007,
 /**/
     1006,