comparison src/testdir/test_let.vim @ 18540:f7bb0e413fe1 v8.1.2264

patch 8.1.2264: there are two test files for :let Commit: https://github.com/vim/vim/commit/fcf8a8743bdecc0ba28037b79b7cb2962de70b1d Author: Bram Moolenaar <Bram@vim.org> Date: Wed Nov 6 15:22:00 2019 +0100 patch 8.1.2264: there are two test files for :let Problem: There are two test files for :let. Solution: Merge the two files.
author Bram Moolenaar <Bram@vim.org>
date Wed, 06 Nov 2019 15:30:04 +0100
parents c0cd979000f9
children baf890fa1621
comparison
equal deleted inserted replaced
18539:8dd30e8de47d 18540:f7bb0e413fe1
150 func Test_let_utf8_environment() 150 func Test_let_utf8_environment()
151 let $a = 'ĀĒĪŌŪあいうえお' 151 let $a = 'ĀĒĪŌŪあいうえお'
152 call assert_equal('ĀĒĪŌŪあいうえお', $a) 152 call assert_equal('ĀĒĪŌŪあいうえお', $a)
153 endfunc 153 endfunc
154 154
155 func Test_let_no_type_checking()
156 let v = 1
157 let v = [1,2,3]
158 let v = {'a': 1, 'b': 2}
159 let v = 3.4
160 let v = 'hello'
161 endfunc
162
163 func Test_let_termcap()
164 " Terminal code
165 let old_t_te = &t_te
166 let &t_te = "\<Esc>[yes;"
167 call assert_match('t_te.*^[[yes;', execute("set termcap"))
168 let &t_te = old_t_te
169
170 if exists("+t_k1")
171 " Key code
172 let old_t_k1 = &t_k1
173 let &t_k1 = "that"
174 call assert_match('t_k1.*that', execute("set termcap"))
175 let &t_k1 = old_t_k1
176 endif
177
178 call assert_fails('let x = &t_xx', 'E113')
179 let &t_xx = "yes"
180 call assert_equal("yes", &t_xx)
181 let &t_xx = ""
182 call assert_fails('let x = &t_xx', 'E113')
183 endfunc
184
185 func Test_let_option_error()
186 let _w = &tw
187 let &tw = 80
188 call assert_fails('let &tw .= 1', 'E734')
189 call assert_equal(80, &tw)
190 let &tw = _w
191
192 let _w = &fillchars
193 let &fillchars = "vert:|"
194 call assert_fails('let &fillchars += "diff:-"', 'E734')
195 call assert_equal("vert:|", &fillchars)
196 let &fillchars = _w
197 endfunc
198
199 func Test_let_errors()
200 let s = 'abcd'
201 call assert_fails('let s[1] = 5', 'E689:')
202
203 let l = [1, 2, 3]
204 call assert_fails('let l[:] = 5', 'E709:')
205 endfunc
206
155 func Test_let_heredoc_fails() 207 func Test_let_heredoc_fails()
156 call assert_fails('let v =<< marker', 'E991:') 208 call assert_fails('let v =<< marker', 'E991:')
157 209
158 let text =<< trim END 210 let text =<< trim END
159 func WrongSyntax() 211 func WrongSyntax()