summaryrefslogtreecommitdiff
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-10-13 14:35:24 +0100
committerBram Moolenaar <Bram@vim.org>2022-10-13 14:35:24 +0100
commitd93009eb35c88bfc38781fefdf42ebdb02c61474 (patch)
tree0db02d04485459b9901d01952385c63b1e23137e /src/testdir
parent4997f2a605e15261c4f825494324371f271ef6a8 (diff)
downloadvim-git-d93009eb35c88bfc38781fefdf42ebdb02c61474.tar.gz
patch 9.0.0741: cannot specify an ID for each item with prop_add_list()v9.0.0741
Problem: Cannot specify an ID for each item with prop_add_list(). (Sergey Vlasov) Solution: Add an optional fifth number to the item. (closes #11360)
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test_textprop.vim10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim
index 34c719d96..39898eb4a 100644
--- a/src/testdir/test_textprop.vim
+++ b/src/testdir/test_textprop.vim
@@ -367,6 +367,16 @@ func Test_prop_add_list()
\ length: 7, start: 1}], prop_list(3))
call assert_equal([#{id: 2, col: 1, type_bufnr: 0, end: 1, type: 'one',
\ length: 5, start: 0}], prop_list(4))
+ call prop_remove(#{id: 2})
+ call assert_equal([], prop_list(1))
+
+ call prop_add_list(#{type: 'one', id: 3},
+ \ [[1, 1, 1, 3], [2, 5, 2, 7, 9]])
+ call assert_equal([#{id: 3, col: 1, type_bufnr: 0, end: 1, type: 'one',
+ \ length: 2, start: 1}], prop_list(1))
+ call assert_equal([#{id: 9, col: 5, type_bufnr: 0, end: 1, type: 'one',
+ \ length: 2, start: 1}], prop_list(2))
+
call assert_fails('call prop_add_list([1, 2], [[1, 1, 3]])', 'E1206:')
call assert_fails('call prop_add_list({}, {})', 'E1211:')
call assert_fails('call prop_add_list({}, [[1, 1, 3]])', 'E965:')