Mercurial > vim
annotate src/testdir/test_syn_attr.vim @ 8981:3b51b0aeb9a3 v7.4.1776
commit https://github.com/vim/vim/commit/a1c487eef71d1673e57511453009de9cb4c9af51
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Apr 22 20:20:19 2016 +0200
patch 7.4.1776
Problem: Using wrong buffer length.
Solution: use the right name. (Kazunobu Kuriyama)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 22 Apr 2016 20:30:05 +0200 |
parents | 24ac80377d86 |
children | 35422e34815f |
rev | line source |
---|---|
8514
260d01c1cd17
commit https://github.com/vim/vim/commit/385111bd86e0b38667879c3e89506ca1ae98e1df
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Test syntax highlighting functions. |
260d01c1cd17
commit https://github.com/vim/vim/commit/385111bd86e0b38667879c3e89506ca1ae98e1df
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 |
260d01c1cd17
commit https://github.com/vim/vim/commit/385111bd86e0b38667879c3e89506ca1ae98e1df
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 func Test_missing_attr() |
260d01c1cd17
commit https://github.com/vim/vim/commit/385111bd86e0b38667879c3e89506ca1ae98e1df
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 hi Mine term=bold cterm=italic |
260d01c1cd17
commit https://github.com/vim/vim/commit/385111bd86e0b38667879c3e89506ca1ae98e1df
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 call assert_equal('Mine', synIDattr(hlID("Mine"), "name")) |
260d01c1cd17
commit https://github.com/vim/vim/commit/385111bd86e0b38667879c3e89506ca1ae98e1df
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 call assert_equal('', synIDattr(hlID("Mine"), "bg", 'term')) |
260d01c1cd17
commit https://github.com/vim/vim/commit/385111bd86e0b38667879c3e89506ca1ae98e1df
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 call assert_equal('1', synIDattr(hlID("Mine"), "bold", 'term')) |
260d01c1cd17
commit https://github.com/vim/vim/commit/385111bd86e0b38667879c3e89506ca1ae98e1df
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 call assert_equal('1', synIDattr(hlID("Mine"), "italic", 'cterm')) |
260d01c1cd17
commit https://github.com/vim/vim/commit/385111bd86e0b38667879c3e89506ca1ae98e1df
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 hi Mine term=reverse cterm=inverse |
260d01c1cd17
commit https://github.com/vim/vim/commit/385111bd86e0b38667879c3e89506ca1ae98e1df
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 call assert_equal('1', synIDattr(hlID("Mine"), "reverse", 'term')) |
260d01c1cd17
commit https://github.com/vim/vim/commit/385111bd86e0b38667879c3e89506ca1ae98e1df
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 call assert_equal('1', synIDattr(hlID("Mine"), "inverse", 'cterm')) |
260d01c1cd17
commit https://github.com/vim/vim/commit/385111bd86e0b38667879c3e89506ca1ae98e1df
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 hi Mine term=underline cterm=standout gui=undercurl |
260d01c1cd17
commit https://github.com/vim/vim/commit/385111bd86e0b38667879c3e89506ca1ae98e1df
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 call assert_equal('1', synIDattr(hlID("Mine"), "underline", 'term')) |
260d01c1cd17
commit https://github.com/vim/vim/commit/385111bd86e0b38667879c3e89506ca1ae98e1df
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 call assert_equal('1', synIDattr(hlID("Mine"), "standout", 'cterm')) |
260d01c1cd17
commit https://github.com/vim/vim/commit/385111bd86e0b38667879c3e89506ca1ae98e1df
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 call assert_equal('1', synIDattr(hlID("Mine"), "undercurl", 'gui')) |
260d01c1cd17
commit https://github.com/vim/vim/commit/385111bd86e0b38667879c3e89506ca1ae98e1df
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 hi Mine term=NONE cterm=NONE gui=NONE |
260d01c1cd17
commit https://github.com/vim/vim/commit/385111bd86e0b38667879c3e89506ca1ae98e1df
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 call assert_equal('', synIDattr(hlID("Mine"), "bold", 'term')) |
260d01c1cd17
commit https://github.com/vim/vim/commit/385111bd86e0b38667879c3e89506ca1ae98e1df
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 call assert_equal('', synIDattr(hlID("Mine"), "italic", 'cterm')) |
260d01c1cd17
commit https://github.com/vim/vim/commit/385111bd86e0b38667879c3e89506ca1ae98e1df
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 call assert_equal('', synIDattr(hlID("Mine"), "reverse", 'term')) |
260d01c1cd17
commit https://github.com/vim/vim/commit/385111bd86e0b38667879c3e89506ca1ae98e1df
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 call assert_equal('', synIDattr(hlID("Mine"), "inverse", 'cterm')) |
260d01c1cd17
commit https://github.com/vim/vim/commit/385111bd86e0b38667879c3e89506ca1ae98e1df
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 call assert_equal('', synIDattr(hlID("Mine"), "underline", 'term')) |
260d01c1cd17
commit https://github.com/vim/vim/commit/385111bd86e0b38667879c3e89506ca1ae98e1df
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 call assert_equal('', synIDattr(hlID("Mine"), "standout", 'cterm')) |
260d01c1cd17
commit https://github.com/vim/vim/commit/385111bd86e0b38667879c3e89506ca1ae98e1df
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 call assert_equal('', synIDattr(hlID("Mine"), "undercurl", 'gui')) |
260d01c1cd17
commit https://github.com/vim/vim/commit/385111bd86e0b38667879c3e89506ca1ae98e1df
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 |
260d01c1cd17
commit https://github.com/vim/vim/commit/385111bd86e0b38667879c3e89506ca1ae98e1df
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 if has('gui') |
8518
24ac80377d86
commit https://github.com/vim/vim/commit/c835293d54c223627c7d4516ee273c21a3506fa1
Christian Brabandt <cb@256bit.org>
parents:
8514
diff
changeset
|
26 let fontname = getfontname() |
24ac80377d86
commit https://github.com/vim/vim/commit/c835293d54c223627c7d4516ee273c21a3506fa1
Christian Brabandt <cb@256bit.org>
parents:
8514
diff
changeset
|
27 if fontname == '' |
24ac80377d86
commit https://github.com/vim/vim/commit/c835293d54c223627c7d4516ee273c21a3506fa1
Christian Brabandt <cb@256bit.org>
parents:
8514
diff
changeset
|
28 let fontname = 'something' |
24ac80377d86
commit https://github.com/vim/vim/commit/c835293d54c223627c7d4516ee273c21a3506fa1
Christian Brabandt <cb@256bit.org>
parents:
8514
diff
changeset
|
29 endif |
24ac80377d86
commit https://github.com/vim/vim/commit/c835293d54c223627c7d4516ee273c21a3506fa1
Christian Brabandt <cb@256bit.org>
parents:
8514
diff
changeset
|
30 exe 'hi Mine guifg=blue guibg=red font=' . escape(fontname, ' \') |
8514
260d01c1cd17
commit https://github.com/vim/vim/commit/385111bd86e0b38667879c3e89506ca1ae98e1df
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 call assert_equal('blue', synIDattr(hlID("Mine"), "fg", 'gui')) |
260d01c1cd17
commit https://github.com/vim/vim/commit/385111bd86e0b38667879c3e89506ca1ae98e1df
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 call assert_equal('red', synIDattr(hlID("Mine"), "bg", 'gui')) |
8518
24ac80377d86
commit https://github.com/vim/vim/commit/c835293d54c223627c7d4516ee273c21a3506fa1
Christian Brabandt <cb@256bit.org>
parents:
8514
diff
changeset
|
33 call assert_equal(fontname, synIDattr(hlID("Mine"), "font", 'gui')) |
8514
260d01c1cd17
commit https://github.com/vim/vim/commit/385111bd86e0b38667879c3e89506ca1ae98e1df
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 endif |
260d01c1cd17
commit https://github.com/vim/vim/commit/385111bd86e0b38667879c3e89506ca1ae98e1df
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 endfunc |