Skip to content

Commit 97b5737

Browse files
committed
tests/plugins/bufferline: test package options
1 parent 910a77a commit 97b5737

File tree

1 file changed

+71
-1
lines changed

1 file changed

+71
-1
lines changed

tests/test-sources/plugins/bufferlines/bufferline.nix

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{ lib, pkgs, ... }:
12
{
23
empty = {
34
plugins.bufferline.enable = true;
@@ -124,10 +125,79 @@
124125
};
125126
};
126127

127-
no-packages = {
128+
default-packages = cfg: {
129+
plugins.bufferline = {
130+
enable = true;
131+
};
132+
133+
assertions = [
134+
{
135+
assertion =
136+
cfg.config.extraPlugins != [ ]
137+
-> lib.any (
138+
x:
139+
lib.trace "${x.pname or x.name}" x.pname or x.name != null && x.pname or x.name == "bufferline.nvim"
140+
) cfg.config.extraPlugins;
141+
message = "nvim-web-devicons package wasn't found when it was expected";
142+
}
143+
{
144+
assertion =
145+
cfg.config.extraPlugins != [ ]
146+
-> lib.any (
147+
x:
148+
lib.trace "${x.pname or x.name}" x.pname or x.name != null
149+
&& x.pname or x.name == "nvim-web-devicons"
150+
) cfg.config.extraPlugins;
151+
message = "nvim-web-devicons package wasn't found when it was expected";
152+
}
153+
];
154+
};
155+
156+
no-packages = cfg: {
128157
plugins.bufferline = {
129158
enable = true;
130159
iconsPackage = null;
131160
};
161+
162+
assertions = [
163+
{
164+
assertion =
165+
cfg.config.extraPlugins != [ ]
166+
-> lib.any (
167+
x:
168+
lib.trace "${x.pname or x.name}" x.pname or x.name != null
169+
&& x.pname or x.name != "nvim-web-devicons"
170+
) cfg.config.extraPlugins;
171+
message = "nvim-web-devicons package was found when it wasn't expected";
172+
}
173+
];
174+
};
175+
176+
package-overrides = cfg: {
177+
plugins.bufferline = {
178+
enable = true;
179+
iconsPackage = pkgs.vimPlugins.mini-nvim;
180+
};
181+
182+
assertions = [
183+
{
184+
assertion =
185+
cfg.config.extraPlugins != [ ]
186+
-> lib.any (
187+
x: lib.trace "${x.pname or x.name}" x.pname or x.name != null && x.pname or x.name == "mini.nvim"
188+
) cfg.config.extraPlugins;
189+
message = "mini-nvim package wasn't found when it was expected";
190+
}
191+
{
192+
assertion =
193+
cfg.config.extraPlugins != [ ]
194+
-> lib.any (
195+
x:
196+
lib.trace "${x.pname or x.name}" x.pname or x.name != null
197+
&& x.pname or x.name != "nvim-web-devicons"
198+
) cfg.config.extraPlugins;
199+
message = "nvim-web-devicons package was found when it wasn't expected";
200+
}
201+
];
132202
};
133203
}

0 commit comments

Comments
 (0)