diff --git a/tests/test-sources/plugins/bufferlines/bufferline.nix b/tests/test-sources/plugins/bufferlines/bufferline.nix index 14b83b4bbf..1a2437cc3f 100644 --- a/tests/test-sources/plugins/bufferlines/bufferline.nix +++ b/tests/test-sources/plugins/bufferlines/bufferline.nix @@ -1,3 +1,4 @@ +{ lib, pkgs, ... }: { empty = { plugins.bufferline.enable = true; @@ -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"; + } + ]; }; }