test: synIDattr returns empty, not -1

- Behavior changed in 7.4.1547
- Also removed N/A specs: nvim does not support ":hi term=..."
This commit is contained in:
Stéphane Campinas 2016-09-11 15:03:22 +01:00 committed by Justin M. Keyes
parent bc1a5db6cc
commit 21eee40cdb
2 changed files with 6 additions and 13 deletions

View File

@ -1,24 +1,17 @@
" Test syntax highlighting functions.
func Test_missing_attr()
hi Mine term=bold cterm=italic
hi Mine 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'))
hi Mine cterm=inverse
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'))
hi Mine cterm=standout gui=undercurl
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'))
hi Mine cterm=NONE gui=NONE
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'))

View File

@ -172,8 +172,8 @@ describe('synIDattr()', function()
it('returns cterm-color if RGB-capable UI is _not_ attached', function()
eq('252', eval('synIDattr(hlID("Normal"), "fg")'))
eq('252', eval('synIDattr(hlID("Normal"), "fg#")'))
eq('-1', eval('synIDattr(hlID("Normal"), "bg")'))
eq('-1', eval('synIDattr(hlID("Normal"), "bg#")'))
eq('', eval('synIDattr(hlID("Normal"), "bg")'))
eq('', eval('synIDattr(hlID("Normal"), "bg#")'))
eq('79', eval('synIDattr(hlID("Keyword"), "fg")'))
eq('79', eval('synIDattr(hlID("Keyword"), "fg#")'))
eq('', eval('synIDattr(hlID("Keyword"), "sp")'))