diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2024-04-15 19:19:52 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-04-15 19:19:52 +0200 |
commit | bce51d9005dd1c5bc002acbac2e12b649abcb013 (patch) | |
tree | 046a2767183c0fd9eff9249fd44ed676db906de3 /src/testdir/test_expr.vim | |
parent | a59e031aa0bdc5cc3d1f4ed719126bf1a1b858ce (diff) |
patch 9.1.0335: String interpolation fails for List typev9.1.0335
Problem: String interpolation fails for List type
Solution: use implicit string(list) for string interpolation and :put =
(Yegappan Lakshmanan)
related: #14529
closes: #14556
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/testdir/test_expr.vim')
-rw-r--r-- | src/testdir/test_expr.vim | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/testdir/test_expr.vim b/src/testdir/test_expr.vim index 1fa460d09a..6acfe002e2 100644 --- a/src/testdir/test_expr.vim +++ b/src/testdir/test_expr.vim @@ -953,6 +953,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 = test_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 = test_null_list() + call assert_equal("a[]b", $'a{nulllist}b') #" Stray closing brace. call assert_fails('echo $"moo}"', 'E1278:') |