diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-04-06 21:35:05 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-04-06 21:35:05 +0200 |
commit | ee4e0c1e9a81cb5d96e0060203a9033c2f28588e (patch) | |
tree | b58b410eb33044a0dadc1838e32de62ceb650e5c /src/testdir/test_highlight.vim | |
parent | 15352dc6ec43fd50cc3be4f4fd1ad74d5619da20 (diff) |
patch 8.2.0522: several errors are not tested forv8.2.0522
Problem: Several errors are not tested for.
Solution: Add tests. (Yegappan Lakshmanan, closes #5892)
Diffstat (limited to 'src/testdir/test_highlight.vim')
-rw-r--r-- | src/testdir/test_highlight.vim | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/testdir/test_highlight.vim b/src/testdir/test_highlight.vim index ac6a10102e..dfc9e24212 100644 --- a/src/testdir/test_highlight.vim +++ b/src/testdir/test_highlight.vim @@ -689,10 +689,28 @@ func Test_1_highlight_Normalgroup_exists() endfunc " Do this test last, sometimes restoring the columns doesn't work -function Test_z_no_space_before_xxx() +func Test_z_no_space_before_xxx() let l:org_columns = &columns set columns=17 let l:hi_StatusLineTermNC = join(split(execute('hi StatusLineTermNC'))) call assert_match('StatusLineTermNC xxx', l:hi_StatusLineTermNC) let &columns = l:org_columns -endfunction +endfunc + +" Test for :highlight command errors +func Test_highlight_cmd_errors() + if has('gui_running') + " This test doesn't fail in the MS-Windows console version. + call assert_fails('hi Xcomment ctermfg=fg', 'E419:') + call assert_fails('hi Xcomment ctermfg=bg', 'E420:') + endif + + " Try using a very long terminal code. Define a dummy terminal code for this + " test. + let &t_fo = "\<Esc>1;" + let c = repeat("t_fo,", 100) . "t_fo" + call assert_fails('exe "hi Xgroup1 start=" . c', 'E422:') + let &t_fo = "" +endfunc + +" vim: shiftwidth=2 sts=2 expandtab |