2016-09-10 12:35:47 -07:00
|
|
|
" Test syntax highlighting functions.
|
|
|
|
|
|
|
|
func Test_missing_attr()
|
2022-07-30 07:11:02 -07:00
|
|
|
throw 'Skipped: use test/functional/legacy/syn_attr_spec.lua'
|
|
|
|
|
|
|
|
hi Mine term=bold cterm=italic
|
2016-09-10 12:35:47 -07:00
|
|
|
call assert_equal('Mine', synIDattr(hlID("Mine"), "name"))
|
2022-07-30 07:11:02 -07:00
|
|
|
call assert_equal('', synIDattr("Mine"->hlID(), "bg", 'term'))
|
|
|
|
call assert_equal('', synIDattr("Mine"->hlID(), "fg", 'term'))
|
|
|
|
call assert_equal('', synIDattr("Mine"->hlID(), "sp", 'term'))
|
|
|
|
call assert_equal('1', synIDattr(hlID("Mine"), "bold", 'term'))
|
2016-09-10 12:35:47 -07:00
|
|
|
call assert_equal('1', synIDattr(hlID("Mine"), "italic", 'cterm'))
|
2022-07-30 07:11:02 -07:00
|
|
|
hi Mine term=reverse cterm=inverse
|
|
|
|
call assert_equal('1', synIDattr(hlID("Mine"), "reverse", 'term'))
|
2016-09-10 12:35:47 -07:00
|
|
|
call assert_equal('1', synIDattr(hlID("Mine"), "inverse", 'cterm'))
|
2022-07-30 07:11:02 -07:00
|
|
|
|
|
|
|
hi Mine term=underline cterm=standout gui=undercurl
|
|
|
|
call assert_equal('1', synIDattr(hlID("Mine"), "underline", 'term'))
|
2016-09-10 12:35:47 -07:00
|
|
|
call assert_equal('1', synIDattr(hlID("Mine"), "standout", 'cterm'))
|
2021-08-31 14:51:29 -07:00
|
|
|
call assert_equal('1', synIDattr("Mine"->hlID(), "undercurl", 'gui'))
|
2022-07-30 07:11:02 -07:00
|
|
|
|
|
|
|
hi Mine term=underdouble cterm=underdotted gui=underdashed
|
|
|
|
call assert_equal('1', synIDattr(hlID("Mine"), "underdouble", 'term'))
|
|
|
|
call assert_equal('1', synIDattr(hlID("Mine"), "underdotted", 'cterm'))
|
|
|
|
call assert_equal('1', synIDattr("Mine"->hlID(), "underdashed", 'gui'))
|
|
|
|
|
|
|
|
hi Mine term=nocombine gui=strikethrough
|
2019-09-14 07:32:38 -07:00
|
|
|
call assert_equal('1', synIDattr(hlID("Mine"), "strikethrough", 'gui'))
|
2022-07-30 07:11:02 -07:00
|
|
|
call assert_equal('1', synIDattr(hlID("Mine"), "nocombine", 'term'))
|
|
|
|
call assert_equal('', synIDattr(hlID("Mine"), "nocombine", 'gui'))
|
|
|
|
hi Mine term=NONE cterm=NONE gui=NONE
|
|
|
|
call assert_equal('', synIDattr(hlID("Mine"), "bold", 'term'))
|
2016-09-10 12:35:47 -07:00
|
|
|
call assert_equal('', synIDattr(hlID("Mine"), "italic", 'cterm'))
|
2022-07-30 07:11:02 -07:00
|
|
|
call assert_equal('', synIDattr(hlID("Mine"), "reverse", 'term'))
|
2016-09-10 12:35:47 -07:00
|
|
|
call assert_equal('', synIDattr(hlID("Mine"), "inverse", 'cterm'))
|
2022-07-30 07:11:02 -07:00
|
|
|
call assert_equal('', synIDattr(hlID("Mine"), "underline", 'term'))
|
2016-09-10 12:35:47 -07:00
|
|
|
call assert_equal('', synIDattr(hlID("Mine"), "standout", 'cterm'))
|
|
|
|
call assert_equal('', synIDattr(hlID("Mine"), "undercurl", 'gui'))
|
2019-09-14 07:32:38 -07:00
|
|
|
call assert_equal('', synIDattr(hlID("Mine"), "strikethrough", 'gui'))
|
2016-09-10 12:35:47 -07:00
|
|
|
|
|
|
|
if has('gui')
|
2016-09-30 06:25:55 -07:00
|
|
|
let fontname = getfontname()
|
|
|
|
if fontname == ''
|
|
|
|
let fontname = 'something'
|
|
|
|
endif
|
2017-01-14 16:41:43 -07:00
|
|
|
exe "hi Mine guifg=blue guibg=red font='" . fontname . "'"
|
2016-09-10 12:35:47 -07:00
|
|
|
call assert_equal('blue', synIDattr(hlID("Mine"), "fg", 'gui'))
|
|
|
|
call assert_equal('red', synIDattr(hlID("Mine"), "bg", 'gui'))
|
2016-09-30 06:25:55 -07:00
|
|
|
call assert_equal(fontname, synIDattr(hlID("Mine"), "font", 'gui'))
|
2016-09-10 12:35:47 -07:00
|
|
|
endif
|
|
|
|
endfunc
|