mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
lib/utils: add mkWarnings
This commit is contained in:
parent
1036b8f8b6
commit
02e16b2a76
3 changed files with 56 additions and 0 deletions
|
@ -490,6 +490,30 @@ let
|
|||
"mkAfter list".foo.bar = lib.mkAfter "Hello!";
|
||||
};
|
||||
};
|
||||
|
||||
testMkWarnings = {
|
||||
expr =
|
||||
(lib.nixvim.mkWarnings "foo-bar" [
|
||||
{
|
||||
when = true;
|
||||
message = "This is the message";
|
||||
}
|
||||
{
|
||||
when = false;
|
||||
message = "This should not be included";
|
||||
}
|
||||
"This is an unconditional warning"
|
||||
])
|
||||
++ (lib.nixvim.mkWarnings "single-element") {
|
||||
when = true;
|
||||
message = "Hello";
|
||||
};
|
||||
expected = [
|
||||
"Nixvim (foo-bar): This is the message"
|
||||
"Nixvim (foo-bar): This is an unconditional warning"
|
||||
"Nixvim (single-element): Hello"
|
||||
];
|
||||
};
|
||||
};
|
||||
in
|
||||
if results == [ ] then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue