From 707e2e923b341d280f6cc4546715c37fb04da9cb Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 26 Jun 2024 11:11:11 +0200 Subject: [PATCH] test: fix init test --- tests/core/init_spec.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/core/init_spec.lua b/tests/core/init_spec.lua index 3a1b4c7..4970871 100644 --- a/tests/core/init_spec.lua +++ b/tests/core/init_spec.lua @@ -1,7 +1,11 @@ +---@module 'luassert' +local Util = require("lazy.core.util") + describe("init", function() it("has correct environment for tests", function() - for _, path in ipairs({ "config", "data", "cache", "state" }) do - assert(vim.fn.stdpath(path):find(".tests/" .. path)) + for _, name in ipairs({ "config", "data", "cache", "state" }) do + local path = Util.norm(vim.fn.stdpath(name) --[[@as string]]) + assert(path:find(".tests/" .. name, 1, true), path .. " not in .tests") end end) end)