mirror of https://github.com/folke/lazy.nvim.git
test: fix tests
This commit is contained in:
parent
983e1c5e34
commit
b68cf58962
|
@ -51,9 +51,7 @@ describe("util", function()
|
||||||
local files = Helpers.fs_create(test.files)
|
local files = Helpers.fs_create(test.files)
|
||||||
|
|
||||||
-- test with empty cache
|
-- test with empty cache
|
||||||
Cache.cache = {}
|
package.loaded["lazy.core.cache"] = nil
|
||||||
Cache._topmods = {}
|
|
||||||
Cache.topmods_rtp = false
|
|
||||||
local root = Util.find_root(test.mod)
|
local root = Util.find_root(test.mod)
|
||||||
assert(root, "no root found for " .. test.mod .. " (test " .. t .. ")")
|
assert(root, "no root found for " .. test.mod .. " (test " .. t .. ")")
|
||||||
assert.same(Helpers.path(test.root), root)
|
assert.same(Helpers.path(test.root), root)
|
||||||
|
@ -65,12 +63,7 @@ describe("util", function()
|
||||||
assert.same(expected, mods)
|
assert.same(expected, mods)
|
||||||
|
|
||||||
-- fill the cache
|
-- fill the cache
|
||||||
Cache.cache = {}
|
package.loaded["lazy.core.cache"] = nil
|
||||||
for i, file in ipairs(files) do
|
|
||||||
Cache.cache[test.mods[i]] = { modpath = file }
|
|
||||||
end
|
|
||||||
Cache._topmods = {}
|
|
||||||
Cache.topmods_rtp = false
|
|
||||||
root = Util.find_root(test.mod)
|
root = Util.find_root(test.mod)
|
||||||
assert(root, "no root found for " .. test.mod .. " (test " .. t .. ")")
|
assert(root, "no root found for " .. test.mod .. " (test " .. t .. ")")
|
||||||
assert.same(Helpers.path(test.root), root)
|
assert.same(Helpers.path(test.root), root)
|
||||||
|
|
Loading…
Reference in New Issue