annotate src/testdir/test_highlight.vim @ 12465:805f7fd40e0d v8.0.1112

patch 8.0.1112: can't get size or current index from quickfix list commit https://github.com/vim/vim/commit/fc2b270cfd36230166df486aae4d96d9d1f32755 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Sep 15 22:43:07 2017 +0200 patch 8.0.1112: can't get size or current index from quickfix list Problem: Can't get size or current index from quickfix list. Solution: Add "idx" and "size" options. (Yegappan Lakshmanan)
author Christian Brabandt <cb@256bit.org>
date Fri, 15 Sep 2017 22:45:04 +0200
parents 7d7835ab8b37
children ba55861aa52c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12019
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Tests for ":highlight".
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2 func Test_highlight()
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3 " basic test if ":highlight" doesn't crash
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 highlight
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5 hi Search
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7 " test setting colors.
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 " test clearing one color and all doesn't generate error or warning
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 silent! hi NewGroup term=bold cterm=italic ctermfg=DarkBlue ctermbg=Grey gui= guifg=#00ff00 guibg=Cyan
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 silent! hi Group2 term= cterm=
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 hi Group3 term=underline cterm=bold
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 let res = split(execute("hi NewGroup"), "\n")[0]
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 " filter ctermfg and ctermbg, the numbers depend on the terminal
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15 let res = substitute(res, 'ctermfg=\d*', 'ctermfg=2', '')
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 let res = substitute(res, 'ctermbg=\d*', 'ctermbg=3', '')
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 call assert_equal("NewGroup xxx term=bold cterm=italic ctermfg=2 ctermbg=3",
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 \ res)
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 call assert_equal("Group2 xxx cleared",
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 \ split(execute("hi Group2"), "\n")[0])
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 call assert_equal("Group3 xxx term=underline cterm=bold",
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 \ split(execute("hi Group3"), "\n")[0])
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 hi clear NewGroup
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 call assert_equal("NewGroup xxx cleared",
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 \ split(execute("hi NewGroup"), "\n")[0])
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27 call assert_equal("Group2 xxx cleared",
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 \ split(execute("hi Group2"), "\n")[0])
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29 hi Group2 NONE
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
30 call assert_equal("Group2 xxx cleared",
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
31 \ split(execute("hi Group2"), "\n")[0])
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
32 hi clear
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
33 call assert_equal("Group3 xxx cleared",
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
34 \ split(execute("hi Group3"), "\n")[0])
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
35 call assert_fails("hi Crash term='asdf", "E475:")
7d7835ab8b37 patch 8.0.0890: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
36 endfunc