Mercurial > vim
diff src/testdir/test_vim9_disassemble.vim @ 20305:9a5e2370df0e v8.2.0708
patch 8.2.0708: Vim9: constant expressions are not simplified
Commit: https://github.com/vim/vim/commit/61a89816996a0cad0d711c91e6e7cea9a9101211
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu May 7 16:58:17 2020 +0200
patch 8.2.0708: Vim9: constant expressions are not simplified
Problem: Vim9: constant expressions are not simplified.
Solution: Simplify string concatenation.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 07 May 2020 17:00:03 +0200 |
parents | e1a8d2040bd7 |
children | 23188ef99fc2 |
line wrap: on
line diff
--- a/src/testdir/test_vim9_disassemble.vim +++ b/src/testdir/test_vim9_disassemble.vim @@ -996,9 +996,7 @@ def Test_disassemble_echomsg() '\d PUSHS "message".*' .. '\d ECHOMSG 2.*' .. "echoerr 'went' .. 'wrong'.*" .. - '\d PUSHS "went".*' .. - '\d PUSHS "wrong".*' .. - '\d CONCAT.*' .. + '\d PUSHS "wentwrong".*' .. '\d ECHOERR 1.*' .. '\d PUSHNR 0.*' .. '\d RETURN', @@ -1037,4 +1035,16 @@ def Test_display_func() res3) enddef +def s:ConcatStrings(): string + return 'one' .. 'two' .. 'three' +enddef + +def Test_simplify_const_expr() + let res = execute('disass s:ConcatStrings') + assert_match('\<SNR>\d*_ConcatStrings.*' .. + '\d PUSHS "onetwothree".*' .. + '\d RETURN', + res) +enddef + " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker