comparison src/testdir/test_python2.vim @ 21198:8531ddd7dd63 v8.2.1150

patch 8.2.1150: ml_get error when using Python Commit: https://github.com/vim/vim/commit/bb790dcc46b74e6f9a1c4126be8a575f9fe73444 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jul 7 20:12:54 2020 +0200 patch 8.2.1150: ml_get error when using Python Problem: ml_get error when using Python. (Yegappan Lakshmanan) Solution: Check the line number is not out of range. Call "Check" with "fromObj" instead of "from".
author Bram Moolenaar <Bram@vim.org>
date Tue, 07 Jul 2020 20:15:04 +0200
parents 10eb6c38938c
children 37edecbfb834
comparison
equal deleted inserted replaced
21197:d68512f02811 21198:8531ddd7dd63
276 py r[10:12] = ["b"] 276 py r[10:12] = ["b"]
277 py r[-10:-9] = ["c"] 277 py r[-10:-9] = ["c"]
278 py r[1:0] = ["d"] 278 py r[1:0] = ["d"]
279 call assert_equal(['c', 'd', 'a', 'two', 'three', 'b'], getline(1, '$')) 279 call assert_equal(['c', 'd', 'a', 'two', 'three', 'b'], getline(1, '$'))
280 280
281 " FIXME: The following code triggers ml_get errors 281 " The following code used to trigger an ml_get error
282 " %d 282 %d
283 " let x = pyeval('r[:]') 283 let x = pyeval('r[:]')
284 284
285 " Non-existing range attribute 285 " Non-existing range attribute
286 call AssertException(["let x = pyeval('r.abc')"], 286 call AssertException(["let x = pyeval('r.abc')"],
287 \ 'Vim(let):AttributeError: abc') 287 \ 'Vim(let):AttributeError: abc')
288 288
330 call AssertException(["py w.height = 5"], 330 call AssertException(["py w.height = 5"],
331 \ 'Vim(python):vim.error: attempt to refer to deleted window') 331 \ 'Vim(python):vim.error: attempt to refer to deleted window')
332 call AssertException(["py vim.current.window = w"], 332 call AssertException(["py vim.current.window = w"],
333 \ 'Vim(python):vim.error: attempt to refer to deleted window') 333 \ 'Vim(python):vim.error: attempt to refer to deleted window')
334 " Try to set one of the options of the closed window 334 " Try to set one of the options of the closed window
335 " FIXME: The following causes ASAN failure 335 " The following caused an ASAN failure
336 "call AssertException(["py wopts['list'] = False"], 336 call AssertException(["py wopts['list'] = False"],
337 " \ 'vim.error: problem while switching windows') 337 \ 'vim.error: attempt to refer to deleted window')
338 call assert_match('<window object (deleted)', pyeval("repr(w)")) 338 call assert_match('<window object (deleted)', pyeval("repr(w)"))
339 %bw! 339 %bw!
340 endfunc 340 endfunc
341 341
342 " Test for the python List object 342 " Test for the python List object