patch 8.2.2520: missing tests for 'listchars'

Problem:    Missing tests for 'listchars'.
Solution:   Add a few more checks. (Yegappan Lakshmanan, closes #7854)
This commit is contained in:
Bram Moolenaar
2021-02-16 21:14:33 +01:00
parent b8554304c3
commit 04ea7e9049
2 changed files with 22 additions and 0 deletions

View File

@ -336,6 +336,26 @@ func Test_listchars_window_local()
close
call assert_equal(['+------+^^one>>two<<%'], ScreenLines(1, virtcol('$')))
" Setting invalid value for a local setting should not impact the local and
" global settings
split
setlocal listchars=tab:<->,lead:_,space:.,trail:@,eol:#
let cmd = 'setlocal listchars=tab:{.},lead:-,space:=,trail:#,eol:$,x'
call assert_fails(cmd, 'E474:')
call assert_equal(['<------>__one..two@@#'], ScreenLines(1, virtcol('$')))
close
call assert_equal(['+------+^^one>>two<<%'], ScreenLines(1, virtcol('$')))
" Setting invalid value for a global setting should not impact the local and
" global settings
split
setlocal listchars=tab:<->,lead:_,space:.,trail:@,eol:#
let cmd = 'setglobal listchars=tab:{.},lead:-,space:=,trail:#,eol:$,x'
call assert_fails(cmd, 'E474:')
call assert_equal(['<------>__one..two@@#'], ScreenLines(1, virtcol('$')))
close
call assert_equal(['+------+^^one>>two<<%'], ScreenLines(1, virtcol('$')))
%bw!
set list& listchars&
endfunc

View File

@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2520,
/**/
2519,
/**/