Skip to content

Commit 3dc3474

Browse files
committed
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 #7908)
1 parent 39d4cab commit 3dc3474

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

src/testdir/test_textprop.vim

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,6 +1338,25 @@ func Test_prop_func_invalid_args()
13381338
call assert_fails("call prop_type_get([])", 'E730:')
13391339
call assert_fails("call prop_type_get('', [])", 'E474:')
13401340
call assert_fails("call prop_type_list([])", 'E715:')
1341+
call assert_fails("call prop_type_add('yyy', 'not_a_dict')", 'E715:')
1342+
call assert_fails("call prop_add(1, 5, {'type':'missing_type', 'length':1})", 'E971:')
1343+
call assert_fails("call prop_add(1, 5, {'type': ''})", 'E971:')
1344+
call assert_fails('call prop_add(1, 1, 0)', 'E715:')
1345+
1346+
new
1347+
call setline(1, ['first', 'second'])
1348+
call prop_type_add('xxx', {})
1349+
1350+
call assert_fails("call prop_type_add('xxx', {})", 'E969:')
1351+
call assert_fails("call prop_add(2, 0, {'type': 'xxx'})", 'E964:')
1352+
call assert_fails("call prop_add(2, 3, {'type': 'xxx', 'end_lnum':1})", 'E475:')
1353+
call assert_fails("call prop_add(2, 3, {'type': 'xxx', 'end_lnum':3})", 'E966:')
1354+
call assert_fails("call prop_add(2, 3, {'type': 'xxx', 'length':-1})", 'E475:')
1355+
call assert_fails("call prop_add(2, 3, {'type': 'xxx', 'end_col':0})", 'E475:')
1356+
call assert_fails("call prop_add(2, 3, {'length':1})", 'E965:')
1357+
1358+
call prop_type_delete('xxx')
1359+
bwipe!
13411360
endfunc
13421361

13431362
func Test_prop_split_join()

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
2561,
753755
/**/
754756
2560,
755757
/**/

0 commit comments

Comments
 (0)