test: added tests for mini.icons
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
---@module 'luassert'
|
||||
|
||||
local Icons = require("mini.icons")
|
||||
|
||||
local Plugin = require("lazy.core.plugin")
|
||||
_G.LazyVim = require("lazyvim.util")
|
||||
|
||||
@ -98,6 +100,28 @@ describe("Extra", function()
|
||||
)
|
||||
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)
|
@ -11,5 +11,6 @@ require("lazy.minit").setup({
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"williamboman/mason.nvim",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
{ "echasnovski/mini.icons", opts = {} },
|
||||
},
|
||||
})
|
||||
|
Reference in New Issue
Block a user