From b68cf58962cd3ab9897459e978a53e6757d36a85 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 13 Feb 2023 10:56:02 +0100 Subject: [PATCH] test: fix tests --- tests/core/util_spec.lua | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/tests/core/util_spec.lua b/tests/core/util_spec.lua index c0ca886..86b9f06 100644 --- a/tests/core/util_spec.lua +++ b/tests/core/util_spec.lua @@ -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)