diff src/testdir/test_highlight.vim @ 19932:2c4d9ca33769 v8.2.0522

patch 8.2.0522: several errors are not tested for Commit: https://github.com/vim/vim/commit/ee4e0c1e9a81cb5d96e0060203a9033c2f28588e Author: Bram Moolenaar <Bram@vim.org> Date: Mon Apr 6 21:35:05 2020 +0200 patch 8.2.0522: several errors are not tested for Problem: Several errors are not tested for. Solution: Add tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5892)
author Bram Moolenaar <Bram@vim.org>
date Mon, 06 Apr 2020 21:45:31 +0200
parents a4b65930a0dc
children c087099e9163
line wrap: on
line diff
--- 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