summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_vim9_expr.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-05-10 18:11:43 +0100
committerBram Moolenaar <Bram@vim.org>2022-05-10 18:11:43 +0100
commit70c41241c2701f26a99085e433925a206ca265a3 (patch)
tree1afeaeb49dfc47199313bf397955519a5f598572 /src/testdir/test_vim9_expr.vim
parentdf6e0e46c55c9c6d788f94482a8858c0f31391f4 (diff)
patch 8.2.4934: string interpolation fails when not evaluatingv8.2.4934
Problem: String interpolation fails when not evaluating. Solution: Skip the expression when not evaluating. (closes #10398)
Diffstat (limited to 'src/testdir/test_vim9_expr.vim')
-rw-r--r--src/testdir/test_vim9_expr.vim7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim
index 202bb58e69..bbe39d1b4d 100644
--- 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()