tests/conform: add darwinOnly test
This commit is contained in:
parent
9077e2f2bc
commit
5a6eda5aa1
1 changed files with 37 additions and 0 deletions
|
|
@ -36,6 +36,43 @@
|
|||
};
|
||||
};
|
||||
|
||||
darwin-only-auto-install =
|
||||
{ config, ... }:
|
||||
let
|
||||
inherit (pkgs.stdenv) isDarwin;
|
||||
in
|
||||
{
|
||||
plugins.conform-nvim = {
|
||||
enable = true;
|
||||
autoInstall.enable = true;
|
||||
settings.formatters_by_ft."*" = [ "swift" ];
|
||||
};
|
||||
|
||||
test = {
|
||||
buildNixvim = false;
|
||||
warnings =
|
||||
expect:
|
||||
if isDarwin then
|
||||
[ (expect "count" 0) ]
|
||||
else
|
||||
[
|
||||
(expect "count" 1)
|
||||
(expect "any" "marked 'Darwin only'")
|
||||
];
|
||||
};
|
||||
|
||||
assertions = [
|
||||
{
|
||||
assertion = isDarwin == lib.elem pkgs.swift config.extraPackages;
|
||||
message =
|
||||
if isDarwin then
|
||||
"Expected `swift` to be in `extraPackages` on Darwin."
|
||||
else
|
||||
"Expected `swift` not to be in `extraPackages` on non-Darwin systems.";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
default = {
|
||||
plugins.conform-nvim = {
|
||||
enable = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue