mirror of
https://github.com/neovim/neovim.git
synced 2026-01-26 07:01:54 +10:00
vim-patch:8.1.1114: confusing overloaded operator "." for string concatenation
Problem: Confusing overloaded operator "." for string concatenation.
Solution: Add ".." for string concatenation. Also "let a ..= b".
0f248b006c
This commit is contained in:
@@ -49,3 +49,32 @@ func Test_line_continuation()
|
||||
"\ and some more
|
||||
call assert_equal([5, 6], array)
|
||||
endfunc
|
||||
|
||||
func Test_string_concatenation()
|
||||
call assert_equal('ab', 'a'.'b')
|
||||
call assert_equal('ab', 'a' .'b')
|
||||
call assert_equal('ab', 'a'. 'b')
|
||||
call assert_equal('ab', 'a' . 'b')
|
||||
|
||||
call assert_equal('ab', 'a'..'b')
|
||||
call assert_equal('ab', 'a' ..'b')
|
||||
call assert_equal('ab', 'a'.. 'b')
|
||||
call assert_equal('ab', 'a' .. 'b')
|
||||
|
||||
let a = 'a'
|
||||
let b = 'b'
|
||||
let a .= b
|
||||
call assert_equal('ab', a)
|
||||
|
||||
let a = 'a'
|
||||
let a.=b
|
||||
call assert_equal('ab', a)
|
||||
|
||||
let a = 'a'
|
||||
let a ..= b
|
||||
call assert_equal('ab', a)
|
||||
|
||||
let a = 'a'
|
||||
let a..=b
|
||||
call assert_equal('ab', a)
|
||||
endfunc
|
||||
|
||||
Reference in New Issue
Block a user