Mercurial > vim
diff src/testdir/test_vim9_expr.vim @ 21903:1fc2ffadf412 v8.2.1501
patch 8.2.1501: Vim9: concatenating to constant reverses order
Commit: https://github.com/vim/vim/commit/3fc71285d5ae7c16cf7be5d997fd1fe140f196da
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Aug 21 20:43:17 2020 +0200
patch 8.2.1501: Vim9: concatenating to constant reverses order
Problem: Vim9: concatenating to constant reverses order.
Solution: Generate constant before option, register and environment
variable. (closes #6757)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 21 Aug 2020 20:45:04 +0200 |
parents | c16af87df654 |
children | 2474c6b0c5de |
line wrap: on
line diff
--- a/src/testdir/test_vim9_expr.vim +++ b/src/testdir/test_vim9_expr.vim @@ -944,6 +944,18 @@ def Test_expr5() + g:ablob) assert_equal(0z01ab3344, g:ablob + 0z3344) assert_equal(0z01ab01ab, g:ablob + g:ablob) + + # concatenate non-constant to constant + let save_path = &path + &path = 'b' + assert_equal('ab', 'a' .. &path) + &path = save_path + + @b = 'b' + assert_equal('ab', 'a' .. @b) + + $ENVVAR = 'env' + assert_equal('aenv', 'a' .. $ENVVAR) enddef def Test_expr5_vim9script()