comparison src/testdir/test_textprop.vim @ 25471:3678a11e71fa v8.2.3272

patch 8.2.3272: cannot use id zero with prop_find() Commit: https://github.com/vim/vim/commit/e041dde7bb9157644fa5135a252c84924b9ea433 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Aug 1 21:30:12 2021 +0200 patch 8.2.3272: cannot use id zero with prop_find() Problem: Cannot use id zero with prop_find(). (Naohiro Ono) Solution: Also accept id zero.
author Bram Moolenaar <Bram@vim.org>
date Sun, 01 Aug 2021 21:45:03 +0200
parents e06540cc3371
children 0ef8ef1af478
comparison
equal deleted inserted replaced
25470:85b99764bb66 25471:3678a11e71fa
237 237
238 " When lnum is given and col is omitted, use column 1. 238 " When lnum is given and col is omitted, use column 1.
239 let result = prop_find({'type': 'prop_name', 'lnum': 1}, 'f') 239 let result = prop_find({'type': 'prop_name', 'lnum': 1}, 'f')
240 call assert_equal(expected[0], result) 240 call assert_equal(expected[0], result)
241 241
242 " When ID is -1 it's like prop is not found. 242 " Negative ID is possible, just like prop is not found.
243 call assert_equal({}, prop_find({'id': -1})) 243 call assert_equal({}, prop_find({'id': -1}))
244 244 call assert_equal({}, prop_find({'id': -2}))
245 call prop_clear(1,6) 245
246 call prop_clear(1, 6)
247
248 " Default ID is zero
249 call prop_add(5, 4, {'type': 'prop_name', 'length': 1})
250 call assert_equal(#{lnum: 5, id: 0, col: 4, type_bufnr: 0, end: 1, type: 'prop_name', length: 1, start: 1}, prop_find({'id': 0}))
251
246 call prop_type_delete('prop_name') 252 call prop_type_delete('prop_name')
247 253 call prop_clear(1, 6)
248 bwipe! 254 bwipe!
249 endfunc 255 endfunc
250 256
251 def Test_prop_find2() 257 def Test_prop_find2()
252 # Multiple props per line, start on the first, should find the second. 258 # Multiple props per line, start on the first, should find the second.