test: fix init test

This commit is contained in:
Folke Lemaitre 2024-06-26 11:11:11 +02:00
parent 90e14d1585
commit 707e2e923b
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 6 additions and 2 deletions

View File

@ -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)