eval: Make setmatches() return -1 in case of some failures

This commit is contained in:
ZyX
2016-08-20 22:25:57 +03:00
parent e18a578308
commit 54bd2e8b73
3 changed files with 21 additions and 8 deletions

View File

@@ -36,4 +36,11 @@ describe('setmatches()', function()
conceal='5',
}}, funcs.getmatches())
end)
it('fails with -1 if highlight group is not defined', function()
eq(-1, funcs.setmatches({{group=1, pattern=2, id=3, priority=4}}))
eq({}, funcs.getmatches())
eq(-1, funcs.setmatches({{group=1, pos1={2}, pos2={6}, id=3, priority=4, conceal=5}}))
eq({}, funcs.getmatches())
end)
end)