test: fix tests

This commit is contained in:
Folke Lemaitre 2023-02-13 10:56:02 +01:00
parent 983e1c5e34
commit b68cf58962
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 2 additions and 9 deletions

View File

@ -51,9 +51,7 @@ describe("util", function()
local files = Helpers.fs_create(test.files)
-- test with empty cache
Cache.cache = {}
Cache._topmods = {}
Cache.topmods_rtp = false
package.loaded["lazy.core.cache"] = nil
local root = Util.find_root(test.mod)
assert(root, "no root found for " .. test.mod .. " (test " .. t .. ")")
assert.same(Helpers.path(test.root), root)
@ -65,12 +63,7 @@ describe("util", function()
assert.same(expected, mods)
-- fill the cache
Cache.cache = {}
for i, file in ipairs(files) do
Cache.cache[test.mods[i]] = { modpath = file }
end
Cache._topmods = {}
Cache.topmods_rtp = false
package.loaded["lazy.core.cache"] = nil
root = Util.find_root(test.mod)
assert(root, "no root found for " .. test.mod .. " (test " .. t .. ")")
assert.same(Helpers.path(test.root), root)