mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 19:05:40 +00:00
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
bce51d9005
Cherry-pick eval_to_string_eap() from patch 8.2.1914.
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
@@ -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:')
|
||||
|
||||
Reference in New Issue
Block a user