From bfc44a91acdfb968cb3d0d21effc4ea9cbcd09e1 Mon Sep 17 00:00:00 2001 From: erw7 Date: Wed, 29 May 2019 12:06:39 +0900 Subject: 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". https://github.com/vim/vim/commit/0f248b006c2574abc00c9aa7886d8f33620eb822 --- src/nvim/testdir/test_eval_stuff.vim | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/nvim/testdir/test_eval_stuff.vim') diff --git a/src/nvim/testdir/test_eval_stuff.vim b/src/nvim/testdir/test_eval_stuff.vim index 1850fb0cf1..19a15590e5 100644 --- a/src/nvim/testdir/test_eval_stuff.vim +++ b/src/nvim/testdir/test_eval_stuff.vim @@ -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 -- cgit