Mercurial > vim
comparison src/testdir/test_vim9_disassemble.vim @ 28623:1d92ba691dc4 v8.2.4835
patch 8.2.4835: Vim9: some lines not covered by tests
Commit: https://github.com/vim/vim/commit/95e4dd813a19236772dbe53eb9f605b4ff5199b2
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Apr 27 22:15:40 2022 +0100
patch 8.2.4835: Vim9: some lines not covered by tests
Problem: Vim9: some lines not covered by tests.
Solution: Add a few more tests. Fix disassemble output.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 27 Apr 2022 23:30:03 +0200 |
parents | d550054e1328 |
children | 56860e29ce5d |
comparison
equal
deleted
inserted
replaced
28622:a2a087110496 | 28623:1d92ba691dc4 |
---|---|
897 | 897 |
898 unlet g:Append | 898 unlet g:Append |
899 unlet g:Get | 899 unlet g:Get |
900 enddef | 900 enddef |
901 | 901 |
902 def s:ClosureArg(arg: string) | |
903 var Ref = () => arg .. "x" | |
904 enddef | |
905 | |
906 def Test_disassemble_closure_arg() | |
907 var res = execute('disass s:ClosureArg') | |
908 assert_match('<SNR>\d\+_ClosureArg\_s*' .. | |
909 'var Ref = () => arg .. "x"\_s*' .. | |
910 '\d FUNCREF <lambda>\d\+', | |
911 res) | |
912 var lres = execute('disass ' .. matchstr(res, '<lambda>\d\+')) | |
913 assert_match('<lambda>\d\+\_s*' .. | |
914 'return arg .. "x"\_s*' .. | |
915 '\d LOADOUTER level 1 arg\[-1]\_s*' .. | |
916 '\d PUSHS "x"\_s*' .. | |
917 '\d CONCAT size 2\_s*' .. | |
918 '\d RETURN', | |
919 lres) | |
920 enddef | |
902 | 921 |
903 def EchoArg(arg: string): string | 922 def EchoArg(arg: string): string |
904 return arg | 923 return arg |
905 enddef | 924 enddef |
906 def s:RefThis(): func | 925 def s:RefThis(): func |
2662 '\d\+ STORE $1\_s*' .. | 2681 '\d\+ STORE $1\_s*' .. |
2663 '\d\+ RETURN void*', | 2682 '\d\+ RETURN void*', |
2664 res) | 2683 res) |
2665 enddef | 2684 enddef |
2666 | 2685 |
2686 def s:RetLegacy(): string | |
2687 legacy return "yes" | |
2688 enddef | |
2689 | |
2690 def Test_disassemble_return_legacy() | |
2691 var res = execute('disass s:RetLegacy') | |
2692 assert_match('<SNR>\d*_RetLegacy\_s*' .. | |
2693 'legacy return "yes"\_s*' .. | |
2694 '\d CMDMOD legacy\_s*' .. | |
2695 '\d EVAL legacy "yes"\_s*' .. | |
2696 '\d CHECKTYPE string stack\[-1]\_s*' .. | |
2697 '\d CMDMOD_REV\_s*' .. | |
2698 '\d RETURN', | |
2699 res) | |
2700 enddef | |
2701 | |
2667 def s:EchoMessages() | 2702 def s:EchoMessages() |
2668 echohl ErrorMsg | echom v:exception | echohl NONE | 2703 echohl ErrorMsg | echom v:exception | echohl NONE |
2669 enddef | 2704 enddef |
2670 | 2705 |
2671 def Test_disassemble_nextcmd() | 2706 def Test_disassemble_nextcmd() |