Skip to content

Commit

Permalink
tests/plugins/bufferline: test package options
Browse files Browse the repository at this point in the history
  • Loading branch information
khaneliman committed Aug 31, 2024
1 parent 910a77a commit 59e1a02
Showing 1 changed file with 62 additions and 1 deletion.
63 changes: 62 additions & 1 deletion tests/test-sources/plugins/bufferlines/bufferline.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{ lib, pkgs, ... }:
{
empty = {
plugins.bufferline.enable = true;
Expand Down Expand Up @@ -124,10 +125,70 @@
};
};

no-packages = {
default-packages = cfg: {
plugins.bufferline = {
enable = true;
};

assertions = [
{
assertion =
cfg.config.extraPlugins != [ ]
-> lib.any (
x:
lib.trace "${x.pname or x.name}" x.pname or x.name != null
&& x.pname or x.name == "nvim-web-devicons"
) cfg.config.extraPlugins;
message = "nvim-web-devicons package wasn't found when it was expected";
}
];
};

no-packages = cfg: {
plugins.bufferline = {
enable = true;
iconsPackage = null;
};

assertions = [
{
assertion =
cfg.config.extraPlugins != [ ]
-> lib.any (
x:
lib.trace "${x.pname or x.name}" x.pname or x.name != null
&& x.pname or x.name != "nvim-web-devicons"
) cfg.config.extraPlugins;
message = "nvim-web-devicons package was found when it wasn't expected";
}
];
};

package-overrides = cfg: {
plugins.bufferline = {
enable = true;
iconsPackage = pkgs.vimPlugins.mini-nvim;
};

assertions = [
{
assertion =
cfg.config.extraPlugins != [ ]
-> lib.any (
x: lib.trace "${x.pname or x.name}" x.pname or x.name != null && x.pname or x.name == "mini.nvim"
) cfg.config.extraPlugins;
message = "mini-nvim package wasn't found when it was expected";
}
{
assertion =
cfg.config.extraPlugins != [ ]
-> lib.any (
x:
lib.trace "${x.pname or x.name}" x.pname or x.name != null
&& x.pname or x.name != "nvim-web-devicons"
) cfg.config.extraPlugins;
message = "nvim-web-devicons package was found when it wasn't expected";
}
];
};
}

0 comments on commit 59e1a02

Please sign in to comment.