To: vim_dev@googlegroups.com Subject: Patch 8.2.1249 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1249 Problem: Vim9: disassemble test fails. Solution: Change INDEX to LISTINDEX. Add test for STRINDEX. Files: src/testdir/test_vim9_disassemble.vim *** ../vim-8.2.1248/src/testdir/test_vim9_disassemble.vim 2020-07-17 20:35:00.857574357 +0200 --- src/testdir/test_vim9_disassemble.vim 2020-07-19 18:37:47.768590234 +0200 *************** *** 898,903 **** --- 898,924 ---- assert_equal('aabb', ConcatString()) enddef + def StringIndex(): number + let s = "abcd" + let res = s[1] + return res + enddef + + def Test_disassemble_string_index() + let instr = execute('disassemble StringIndex') + assert_match('StringIndex\_s*' .. + 'let s = "abcd"\_s*' .. + '\d PUSHS "abcd"\_s*' .. + '\d STORE $0\_s*' .. + 'let res = s\[1]\_s*' .. + '\d LOAD $0\_s*' .. + '\d PUSHNR 1\_s*' .. + '\d STRINDEX\_s*' .. + '\d STORE $1\_s*', + instr) + assert_equal('b', StringIndex()) + enddef + def ListIndex(): number let l = [1, 2, 3] let res = l[1] *************** *** 916,922 **** 'let res = l\[1]\_s*' .. '\d LOAD $0\_s*' .. '\d PUSHNR 1\_s*' .. ! '\d INDEX\_s*' .. '\d STORE $1\_s*', instr) assert_equal(2, ListIndex()) --- 937,943 ---- 'let res = l\[1]\_s*' .. '\d LOAD $0\_s*' .. '\d PUSHNR 1\_s*' .. ! '\d LISTINDEX\_s*' .. '\d STORE $1\_s*', instr) assert_equal(2, ListIndex()) *** ../vim-8.2.1248/src/version.c 2020-07-19 18:24:28.394951652 +0200 --- src/version.c 2020-07-19 18:35:43.076966436 +0200 *************** *** 756,757 **** --- 756,759 ---- { /* Add new patch number below this line */ + /**/ + 1249, /**/ -- I started out with nothing, and I still have most of it. -- Michael Davis -- "Tonight Show" /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///