]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.1008: Vim9: no test for disassambling newly added instructions v8.2.1008
authorBram Moolenaar <Bram@vim.org>
Thu, 18 Jun 2020 20:18:18 +0000 (22:18 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 18 Jun 2020 20:18:18 +0000 (22:18 +0200)
Problem:    Vim9: no test for disassambling newly added instructions.
Solution:   Add a function and check disassembly.

src/testdir/test_vim9_disassemble.vim
src/version.c

index 2e541d9f924b67926ebdf54f5a31da9b7e831ec7..557b90bcc57ba0b1828b784c6cbbb2e61a250958 100644 (file)
@@ -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
index 6ea02b95ad66de33b6f8fb6251199615084f7b8c..a3fedf1cde372e88025565e999f8d33310f81f62 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1008,
 /**/
     1007,
 /**/