aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/highlight_spec.lua
diff options
context:
space:
mode:
authorMatthieu Coudron <mattator@gmail.com>2017-09-03 05:25:57 +0200
committerMatthieu Coudron <mattator@gmail.com>2017-09-30 11:43:26 +0900
commit3a006486397d611234abd9b429bce0b44d6b7747 (patch)
treebdb052dd9667e9900ddd6e1d281760700e5182b6 /test/functional/api/highlight_spec.lua
parente3a2cca3878f44252eccdc1918cc8854145de860 (diff)
downloadrneovim-3a006486397d611234abd9b429bce0b44d6b7747.tar.gz
rneovim-3a006486397d611234abd9b429bce0b44d6b7747.tar.bz2
rneovim-3a006486397d611234abd9b429bce0b44d6b7747.zip
Changed prototypes to accept a boolean "rgb"
Diffstat (limited to 'test/functional/api/highlight_spec.lua')
-rw-r--r--test/functional/api/highlight_spec.lua20
1 files changed, 9 insertions, 11 deletions
diff --git a/test/functional/api/highlight_spec.lua b/test/functional/api/highlight_spec.lua
index a5d3871d13..4082b0daf9 100644
--- a/test/functional/api/highlight_spec.lua
+++ b/test/functional/api/highlight_spec.lua
@@ -27,14 +27,13 @@ describe('highlight api',function()
it("nvim_get_hl_by_id", function()
local hl_id = eval("hlID('NewHighlight')")
- eq(expected_cterm, nvim("get_hl_by_id", hl_id))
+ eq(expected_cterm, nvim("get_hl_by_id", hl_id, false))
- command('set termguicolors')
hl_id = eval("hlID('NewHighlight')")
- eq(expected_rgb, nvim("get_hl_by_id", hl_id))
+ eq(expected_rgb, nvim("get_hl_by_id", hl_id, true))
- -- assume there is no hl with id 30000
- local err, emsg = pcall(meths.get_hl_by_id, 30000)
+ -- assume there is no hl with id = 30000
+ local err, emsg = pcall(meths.get_hl_by_id, 30000, false)
eq(false, err)
ok(string.find(emsg, 'Invalid highlight id') ~= nil)
end)
@@ -44,16 +43,15 @@ describe('highlight api',function()
foreground = Screen.colors.Red }
-- test "Normal" hl defaults
- eq({}, nvim("get_hl_by_name", 'Normal'))
+ eq({}, nvim("get_hl_by_name", 'Normal', true))
- eq(expected_cterm, nvim("get_hl_by_name", 'NewHighlight'))
- command('set termguicolors')
- eq(expected_rgb, nvim("get_hl_by_name", 'NewHighlight'))
+ eq(expected_cterm, nvim("get_hl_by_name", 'NewHighlight', false))
+ eq(expected_rgb, nvim("get_hl_by_name", 'NewHighlight', true))
command('hi Normal guifg=red guibg=yellow')
- eq(expected_normal, nvim("get_hl_by_name", 'Normal'))
+ eq(expected_normal, nvim("get_hl_by_name", 'Normal', true))
- local err, emsg = pcall(meths.get_hl_by_name , 'unknown_highlight')
+ local err, emsg = pcall(meths.get_hl_by_name , 'unknown_highlight', false)
eq(false, err)
ok(string.find(emsg, 'Invalid highlight name') ~= nil)
end)