comparison src/testdir/test_expr.vim @ 28002:1012048eed26 v8.2.4526

patch 8.2.4526: Vim9: cannot set variables to a null value Commit: https://github.com/vim/vim/commit/8acb9cc6209768ca7ec75c9f7af8c389312ea8d6 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Mar 8 13:18:55 2022 +0000 patch 8.2.4526: Vim9: cannot set variables to a null value Problem: Vim9: cannot set variables to a null value. Solution: Add null_list, null_job, etc.
author Bram Moolenaar <Bram@vim.org>
date Tue, 08 Mar 2022 14:30:05 +0100
parents dd7d94b911fa
children d10d5cc8e657
comparison
equal deleted inserted replaced
28001:5357aeb3985f 28002:1012048eed26
155 call v9.CheckLegacyAndVim9Failure(['call getreg([])'], ['E730:', 'E1013:', 'E1174:']) 155 call v9.CheckLegacyAndVim9Failure(['call getreg([])'], ['E730:', 'E1013:', 'E1174:'])
156 endfunc 156 endfunc
157 157
158 func Test_loop_over_null_list() 158 func Test_loop_over_null_list()
159 let lines =<< trim END 159 let lines =<< trim END
160 VAR null_list = test_null_list() 160 VAR nulllist = test_null_list()
161 for i in null_list 161 for i in nulllist
162 call assert_report('should not get here') 162 call assert_report('should not get here')
163 endfor 163 endfor
164 END 164 END
165 call v9.CheckLegacyAndVim9Success(lines) 165 call v9.CheckLegacyAndVim9Success(lines)
166
167 let lines =<< trim END
168 var nulllist = null_list
169 for i in nulllist
170 call assert_report('should not get here')
171 endfor
172 END
173 call v9.CheckDefAndScriptSuccess(lines)
174
175 let lines =<< trim END
176 let nulllist = null_list
177 for i in nulllist
178 call assert_report('should not get here')
179 endfor
180 END
181 call v9.CheckScriptFailure(lines, 'E121: Undefined variable: null_list')
166 endfunc 182 endfunc
167 183
168 func Test_setreg_null_list() 184 func Test_setreg_null_list()
169 let lines =<< trim END 185 let lines =<< trim END
170 call setreg('x', test_null_list()) 186 call setreg('x', test_null_list())