# HG changeset patch # User Bram Moolenaar # Date 1614689105 -3600 # Node ID a5478836fcb770f34d5fb3fa25e06ea71d93e5ac # Parent 52c3c86b10f10bf146a39c5a9b4b24f827a3ad01 patch 8.2.2561: not all textprop code is covered by tests Commit: https://github.com/vim/vim/commit/3dc3474f00e529b014add48f7f3d1dad2ec15498 Author: Bram Moolenaar Date: Tue Mar 2 13:36:47 2021 +0100 patch 8.2.2561: not all textprop code is covered by tests Problem: Not all textprop code is covered by tests. Solution: Add a few more test cases. (Dominique Pell?, closes https://github.com/vim/vim/issues/7908) diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim --- a/src/testdir/test_textprop.vim +++ b/src/testdir/test_textprop.vim @@ -1338,6 +1338,25 @@ func Test_prop_func_invalid_args() call assert_fails("call prop_type_get([])", 'E730:') call assert_fails("call prop_type_get('', [])", 'E474:') call assert_fails("call prop_type_list([])", 'E715:') + call assert_fails("call prop_type_add('yyy', 'not_a_dict')", 'E715:') + call assert_fails("call prop_add(1, 5, {'type':'missing_type', 'length':1})", 'E971:') + call assert_fails("call prop_add(1, 5, {'type': ''})", 'E971:') + call assert_fails('call prop_add(1, 1, 0)', 'E715:') + + new + call setline(1, ['first', 'second']) + call prop_type_add('xxx', {}) + + call assert_fails("call prop_type_add('xxx', {})", 'E969:') + call assert_fails("call prop_add(2, 0, {'type': 'xxx'})", 'E964:') + call assert_fails("call prop_add(2, 3, {'type': 'xxx', 'end_lnum':1})", 'E475:') + call assert_fails("call prop_add(2, 3, {'type': 'xxx', 'end_lnum':3})", 'E966:') + call assert_fails("call prop_add(2, 3, {'type': 'xxx', 'length':-1})", 'E475:') + call assert_fails("call prop_add(2, 3, {'type': 'xxx', 'end_col':0})", 'E475:') + call assert_fails("call prop_add(2, 3, {'length':1})", 'E965:') + + call prop_type_delete('xxx') + bwipe! endfunc func Test_prop_split_join() diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2561, +/**/ 2560, /**/ 2559,