mirror of
https://github.com/vim/vim.git
synced 2025-10-18 07:54:29 -04:00
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".
This commit is contained in:
@@ -94,3 +94,32 @@ func Test_let_errmsg()
|
||||
call assert_fails('let v:errmsg = []', 'E730:')
|
||||
let v:errmsg = ''
|
||||
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