Skip to content

Commit 7756618

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

File tree

1 file changed

+81
-5
lines changed

1 file changed

+81
-5
lines changed

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

Lines changed: 81 additions & 5 deletions
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,85 @@
124125
};
125126
};
126127

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

0 commit comments

Comments
 (0)