diff options
Diffstat (limited to 'test/functional/api/highlight_spec.lua')
-rw-r--r-- | test/functional/api/highlight_spec.lua | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/test/functional/api/highlight_spec.lua b/test/functional/api/highlight_spec.lua index 03b407f4e0..06cdb0bc19 100644 --- a/test/functional/api/highlight_spec.lua +++ b/test/functional/api/highlight_spec.lua @@ -28,8 +28,11 @@ describe('API: highlight',function() bold = true, italic = true, reverse = true, - undercurl = true, underline = true, + underlineline = true, + undercurl = true, + underdot = true, + underdash = true, strikethrough = true, } @@ -52,7 +55,7 @@ describe('API: highlight',function() eq('Invalid highlight id: 30000', string.match(emsg, 'Invalid.*')) -- Test all highlight properties. - command('hi NewHighlight gui=underline,bold,undercurl,italic,reverse,strikethrough') + command('hi NewHighlight gui=underline,bold,underlineline,undercurl,underdot,underdash,italic,reverse,strikethrough') eq(expected_rgb2, nvim("get_hl_by_id", hl_id, true)) -- Test nil argument. @@ -195,6 +198,9 @@ describe("API: set highlight", function() reverse = true, undercurl = true, underline = true, + underdash = true, + underdot = true, + underlineline = true, strikethrough = true, cterm = { italic = true, @@ -211,6 +217,9 @@ describe("API: set highlight", function() reverse = true, undercurl = true, underline = true, + underdash = true, + underdot = true, + underlineline = true, strikethrough = true, } local highlight3_result_cterm = { @@ -274,7 +283,7 @@ describe("API: set highlight", function() exec_capture('highlight Test_hl')) meths.set_hl(0, 'Test_hl2', highlight3_config) - eq('Test_hl2 xxx cterm=undercurl,italic,reverse,strikethrough ctermfg=8 ctermbg=15 gui=bold,underline,undercurl,italic,reverse,strikethrough guifg=#ff0000 guibg=#0032aa', + eq('Test_hl2 xxx cterm=undercurl,italic,reverse,strikethrough ctermfg=8 ctermbg=15 gui=bold,underline,underlineline,undercurl,underdot,underdash,italic,reverse,strikethrough guifg=#ff0000 guibg=#0032aa', exec_capture('highlight Test_hl2')) -- Colors are stored exactly as they are defined. @@ -304,10 +313,6 @@ describe("API: set highlight", function() eq('Test_hl3 xxx ctermbg=9', exec_capture('highlight Test_hl3')) - meths.set_hl(0, 'Test_hl3', {}) - eq('Test_hl3 xxx cleared', - exec_capture('highlight Test_hl3')) - eq("'redd' is not a valid color", pcall_err(meths.set_hl, 0, 'Test_hl3', {fg='redd'})) @@ -320,5 +325,16 @@ describe("API: set highlight", function() eq("'#FF00FF' is not a valid color", pcall_err(meths.set_hl, 0, 'Test_hl3', {ctermfg='#FF00FF'})) + + for _, fg_val in ipairs{ nil, 'NONE', 'nOnE', '', -1 } do + meths.set_hl(0, 'Test_hl3', {fg = fg_val}) + eq('Test_hl3 xxx cleared', + exec_capture('highlight Test_hl3')) + end + + meths.set_hl(0, 'Test_hl3', {fg='#FF00FF', blend=50}) + eq('Test_hl3 xxx guifg=#FF00FF blend=50', + exec_capture('highlight Test_hl3')) + end) end) |