mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-08-13 22:29:19 +02:00
test: added tests for mini.icons
This commit is contained in:
parent
33e1da585d
commit
09831414cf
2 changed files with 25 additions and 0 deletions
|
@ -1,5 +1,7 @@
|
||||||
---@module 'luassert'
|
---@module 'luassert'
|
||||||
|
|
||||||
|
local Icons = require("mini.icons")
|
||||||
|
|
||||||
local Plugin = require("lazy.core.plugin")
|
local Plugin = require("lazy.core.plugin")
|
||||||
_G.LazyVim = require("lazyvim.util")
|
_G.LazyVim = require("lazyvim.util")
|
||||||
|
|
||||||
|
@ -98,6 +100,28 @@ describe("Extra", function()
|
||||||
)
|
)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Icons
|
||||||
|
local icons = spec.plugins["mini.icons"]
|
||||||
|
if icons then
|
||||||
|
local icon_opts = Plugin.values(icons, "opts", false) or {}
|
||||||
|
local cats = { "directory", "file", "extension", "filetype", "lsp", "os" }
|
||||||
|
for _, cat in ipairs(cats) do
|
||||||
|
local cat_names = Icons.list(cat)
|
||||||
|
if icon_opts[cat] then
|
||||||
|
describe("does not set existing icons for " .. cat, function()
|
||||||
|
for icon_name in pairs(icon_opts[cat]) do
|
||||||
|
it(icon_name, function()
|
||||||
|
assert.is_false(
|
||||||
|
vim.tbl_contains(cat_names, icon_name),
|
||||||
|
"Icon " .. icon_name .. " already exists:\n" .. vim.inspect({ Icons.get(cat, icon_name) })
|
||||||
|
)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
|
@ -11,5 +11,6 @@ require("lazy.minit").setup({
|
||||||
"williamboman/mason-lspconfig.nvim",
|
"williamboman/mason-lspconfig.nvim",
|
||||||
"williamboman/mason.nvim",
|
"williamboman/mason.nvim",
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
{ "echasnovski/mini.icons", opts = {} },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue