aboutsummaryrefslogtreecommitdiff
path: root/test/old/testdir/test_expr.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-04-16 10:18:24 +0800
committerGitHub <noreply@github.com>2024-04-16 10:18:24 +0800
commite3c083832c77eb7c24442bd10bbb718599a764d9 (patch)
tree14fe2dfcfd05b95d57a01f2603f5d8760935fd52 /test/old/testdir/test_expr.vim
parentb1e8b799a58f2b984b18940bb134996651aac248 (diff)
downloadrneovim-e3c083832c77eb7c24442bd10bbb718599a764d9.tar.gz
rneovim-e3c083832c77eb7c24442bd10bbb718599a764d9.tar.bz2
rneovim-e3c083832c77eb7c24442bd10bbb718599a764d9.zip
vim-patch:9.1.0335: String interpolation fails for List type (#28364)
Problem: String interpolation fails for List type Solution: use implicit string(list) for string interpolation and :put = (Yegappan Lakshmanan) related: vim/vim#14529 closes: vim/vim#14556 https://github.com/vim/vim/commit/bce51d9005dd1c5bc002acbac2e12b649abcb013 Cherry-pick eval_to_string_eap() from patch 8.2.1914. Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Diffstat (limited to 'test/old/testdir/test_expr.vim')
-rw-r--r--test/old/testdir/test_expr.vim12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/old/testdir/test_expr.vim b/test/old/testdir/test_expr.vim
index 82377aaf19..8871e7e7d7 100644
--- a/test/old/testdir/test_expr.vim
+++ b/test/old/testdir/test_expr.vim
@@ -907,6 +907,18 @@ func Test_string_interp()
#" Dict interpolation
VAR d = {'a': 10, 'b': [1, 2]}
call assert_equal("{'a': 10, 'b': [1, 2]}", $'{d}')
+ VAR emptydict = {}
+ call assert_equal("a{}b", $'a{emptydict}b')
+ VAR nulldict = v:_null_dict
+ call assert_equal("a{}b", $'a{nulldict}b')
+
+ #" List interpolation
+ VAR l = ['a', 'b', 'c']
+ call assert_equal("['a', 'b', 'c']", $'{l}')
+ VAR emptylist = []
+ call assert_equal("a[]b", $'a{emptylist}b')
+ VAR nulllist = v:_null_list
+ call assert_equal("a[]b", $'a{nulllist}b')
#" Stray closing brace.
call assert_fails('echo $"moo}"', 'E1278:')