0
0
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:
Bram Moolenaar
2019-04-04 15:36:05 +02:00
parent eb93f3f0e2
commit 0f248b006c
4 changed files with 59 additions and 15 deletions

View File

@@ -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