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 23a9196
Showing 1 changed file with 81 additions and 5 deletions.
86 changes: 81 additions & 5 deletions 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,85 @@
};
};

no-packages = {
plugins.bufferline = {
enable = true;
iconsPackage = null;
default-packages =
{ config, ... }:
{
plugins.bufferline = {
enable = true;
};

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

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

assertions = [
{
assertion =
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"
) config.extraPlugins;
message = "nvim-web-devicons package was found when it wasn't expected";
}
];
};

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

assertions = [
{
assertion =
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"
) config.extraPlugins;
message = "mini-nvim package wasn't found when it was expected";
}
{
assertion =
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"
) config.extraPlugins;
message = "nvim-web-devicons package was found when it wasn't expected";
}
];
};
};
}

0 comments on commit 23a9196

Please sign in to comment.