Mercurial > vim
comparison src/testdir/test_eval_stuff.vim @ 16219:bd49e1656c72 v8.1.1114
patch 8.1.1114: confusing overloaded operator "." for string concatenation
commit https://github.com/vim/vim/commit/0f248b006c2574abc00c9aa7886d8f33620eb822
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Apr 4 15:36:05 2019 +0200
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".
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 04 Apr 2019 15:45:04 +0200 |
parents | e26caeb30026 |
children | abb67309c1ca |
comparison
equal
deleted
inserted
replaced
16218:0874f5cbaaa6 | 16219:bd49e1656c72 |
---|---|
92 call assert_fails('let v:errmsg = []', 'E730:') | 92 call assert_fails('let v:errmsg = []', 'E730:') |
93 let v:errmsg = '' | 93 let v:errmsg = '' |
94 call assert_fails('let v:errmsg = []', 'E730:') | 94 call assert_fails('let v:errmsg = []', 'E730:') |
95 let v:errmsg = '' | 95 let v:errmsg = '' |
96 endfunc | 96 endfunc |
97 | |
98 func Test_string_concatenation() | |
99 call assert_equal('ab', 'a'.'b') | |
100 call assert_equal('ab', 'a' .'b') | |
101 call assert_equal('ab', 'a'. 'b') | |
102 call assert_equal('ab', 'a' . 'b') | |
103 | |
104 call assert_equal('ab', 'a'..'b') | |
105 call assert_equal('ab', 'a' ..'b') | |
106 call assert_equal('ab', 'a'.. 'b') | |
107 call assert_equal('ab', 'a' .. 'b') | |
108 | |
109 let a = 'a' | |
110 let b = 'b' | |
111 let a .= b | |
112 call assert_equal('ab', a) | |
113 | |
114 let a = 'a' | |
115 let a.=b | |
116 call assert_equal('ab', a) | |
117 | |
118 let a = 'a' | |
119 let a ..= b | |
120 call assert_equal('ab', a) | |
121 | |
122 let a = 'a' | |
123 let a..=b | |
124 call assert_equal('ab', a) | |
125 endfunc |