Mercurial > vim
diff src/testdir/test_vim9_expr.vim @ 28821:006d525419fa v8.2.4934
patch 8.2.4934: string interpolation fails when not evaluating
Commit: https://github.com/vim/vim/commit/70c41241c2701f26a99085e433925a206ca265a3
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue May 10 18:11:43 2022 +0100
patch 8.2.4934: string interpolation fails when not evaluating
Problem: String interpolation fails when not evaluating.
Solution: Skip the expression when not evaluating. (closes https://github.com/vim/vim/issues/10398)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 10 May 2022 19:15:03 +0200 |
parents | acca2214cabf |
children | bf013128ccf4 |
line wrap: on
line diff
--- a/src/testdir/test_vim9_expr.vim +++ b/src/testdir/test_vim9_expr.vim @@ -2156,6 +2156,13 @@ def Test_expr8_string() ->split($'x{x}x') ->map((_, v: string) => v =~ 'bar') assert_equal([false, true, false], vl) + + # interpolated string in a lambda + lines =<< trim END + assert_equal(['gnome-256color', 'xterm-256color'], ['gnome', 'xterm'] + ->map((_, term: string) => $'{term}-256color')) + END + v9.CheckDefAndScriptSuccess(lines) enddef def Test_expr8_vimvar()