Mercurial > vim
view src/testdir/test_syn_attr.vim @ 8746:4c38a4733578 v7.4.1662
commit https://github.com/vim/vim/commit/c4dcd60c76666bf113719f929709ad6120eb6528
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Mar 26 22:56:46 2016 +0100
patch 7.4.1662
Problem: No test for an invalid Ex command on a channel.
Solution: Test handling an invalid command gracefully. Avoid getting an
error message, do write it to the channel log.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 26 Mar 2016 23:00:05 +0100 |
parents | 24ac80377d86 |
children | 35422e34815f |
line wrap: on
line source
" Test syntax highlighting functions. func Test_missing_attr() hi Mine term=bold cterm=italic call assert_equal('Mine', synIDattr(hlID("Mine"), "name")) call assert_equal('', synIDattr(hlID("Mine"), "bg", 'term')) call assert_equal('1', synIDattr(hlID("Mine"), "bold", 'term')) call assert_equal('1', synIDattr(hlID("Mine"), "italic", 'cterm')) hi Mine term=reverse cterm=inverse call assert_equal('1', synIDattr(hlID("Mine"), "reverse", 'term')) call assert_equal('1', synIDattr(hlID("Mine"), "inverse", 'cterm')) hi Mine term=underline cterm=standout gui=undercurl call assert_equal('1', synIDattr(hlID("Mine"), "underline", 'term')) call assert_equal('1', synIDattr(hlID("Mine"), "standout", 'cterm')) call assert_equal('1', synIDattr(hlID("Mine"), "undercurl", 'gui')) hi Mine term=NONE cterm=NONE gui=NONE call assert_equal('', synIDattr(hlID("Mine"), "bold", 'term')) call assert_equal('', synIDattr(hlID("Mine"), "italic", 'cterm')) call assert_equal('', synIDattr(hlID("Mine"), "reverse", 'term')) call assert_equal('', synIDattr(hlID("Mine"), "inverse", 'cterm')) call assert_equal('', synIDattr(hlID("Mine"), "underline", 'term')) call assert_equal('', synIDattr(hlID("Mine"), "standout", 'cterm')) call assert_equal('', synIDattr(hlID("Mine"), "undercurl", 'gui')) if has('gui') let fontname = getfontname() if fontname == '' let fontname = 'something' endif exe 'hi Mine guifg=blue guibg=red font=' . escape(fontname, ' \') call assert_equal('blue', synIDattr(hlID("Mine"), "fg", 'gui')) call assert_equal('red', synIDattr(hlID("Mine"), "bg", 'gui')) call assert_equal(fontname, synIDattr(hlID("Mine"), "font", 'gui')) endif endfunc