aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2021-08-18 14:29:42 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2021-08-19 15:08:50 +0200
commitfca52f5f32844d8820e6a1ef2678bc79c5e6d8d8 (patch)
tree8db37b73b1f5d2b7b176ab8deaf08d19f33f778b /test
parenta9f563ab62f6035729f79c3c701a5b219f1b982f (diff)
downloadrneovim-fca52f5f32844d8820e6a1ef2678bc79c5e6d8d8.tar.gz
rneovim-fca52f5f32844d8820e6a1ef2678bc79c5e6d8d8.tar.bz2
rneovim-fca52f5f32844d8820e6a1ef2678bc79c5e6d8d8.zip
feat(match): allow hl group to be defined after :match command
Diffstat (limited to 'test')
-rw-r--r--test/functional/eval/match_functions_spec.lua15
1 files changed, 7 insertions, 8 deletions
diff --git a/test/functional/eval/match_functions_spec.lua b/test/functional/eval/match_functions_spec.lua
index f399ef47d3..9f168c913a 100644
--- a/test/functional/eval/match_functions_spec.lua
+++ b/test/functional/eval/match_functions_spec.lua
@@ -6,7 +6,6 @@ local clear = helpers.clear
local funcs = helpers.funcs
local command = helpers.command
local exc_exec = helpers.exc_exec
-local pcall_err = helpers.pcall_err
before_each(clear)
@@ -40,13 +39,13 @@ describe('setmatches()', function()
}}, funcs.getmatches())
end)
- it('fails with -1 if highlight group is not defined', function()
- eq('Vim:E28: No such highlight group name: 1',
- pcall_err(funcs.setmatches, {{group=1, pattern=2, id=3, priority=4}}))
- eq({}, funcs.getmatches())
- eq('Vim:E28: No such highlight group name: 1',
- pcall_err(funcs.setmatches, {{group=1, pos1={2}, pos2={6}, id=3, priority=4, conceal=5}}))
- eq({}, funcs.getmatches())
+ it('does not fail if highlight group is not defined', function()
+ eq(0, funcs.setmatches{{group=1, pattern=2, id=3, priority=4}})
+ eq({{group='1', pattern='2', id=3, priority=4}},
+ funcs.getmatches())
+ eq(0, funcs.setmatches{{group=1, pos1={2}, pos2={6}, id=3, priority=4, conceal=5}})
+ eq({{group='1', pos1={2}, pos2={6}, id=3, priority=4, conceal='5'}},
+ funcs.getmatches())
end)
end)