feat: lazy handler implies opt=true

This commit is contained in:
Folke Lemaitre 2022-11-29 19:58:23 +01:00
parent 54526e062a
commit b796abcc33
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
3 changed files with 19 additions and 3 deletions

View file

@ -63,6 +63,15 @@ describe("plugin spec opt", function()
assert(spec.plugins.dep1.opt == false)
end)
it("handles opt from dep", function()
Config.options.opt = false
local spec = Plugin.Spec.new({ "foo/bar", module = "foo" })
Plugin.update_state({ plugins = spec.plugins })
assert.same(1, vim.tbl_count(spec.plugins))
assert(spec.plugins.bar.dep ~= true)
assert(spec.plugins.bar.opt == true)
end)
it("merges lazy loaders", function()
local tests = {
{ { "foo/bar", module = "mod1" }, { "foo/bar", module = "mod2" } },