summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_eval_stuff.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-04-04 15:36:05 +0200
committerBram Moolenaar <Bram@vim.org>2019-04-04 15:36:05 +0200
commit0f248b006c2574abc00c9aa7886d8f33620eb822 (patch)
treece29155e87c3dca50ab5b56b468647449bfee814 /src/testdir/test_eval_stuff.vim
parenteb93f3f0e2b2ae65c5c3f55be3e62d64e3066f35 (diff)
patch 8.1.1114: confusing overloaded operator "." for string concatenationv8.1.1114
Problem: Confusing overloaded operator "." for string concatenation. Solution: Add ".." for string concatenation. Also "let a ..= b".
Diffstat (limited to 'src/testdir/test_eval_stuff.vim')
-rw-r--r--src/testdir/test_eval_stuff.vim29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/testdir/test_eval_stuff.vim b/src/testdir/test_eval_stuff.vim
index f4b35983d9..6d61ce9244 100644
--- a/src/testdir/test_eval_stuff.vim
+++ b/src/testdir/test_eval_stuff.vim
@@ -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