mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-18 19:51:17 +00:00
Add mkAssert.
svn path=/nixpkgs/trunk/; revision=26600
This commit is contained in:
parent
56ade5fef2
commit
11472a0501
|
@ -223,6 +223,11 @@ rec {
|
|||
content = mkNotdef;
|
||||
};
|
||||
|
||||
mkAssert = assertion: message: content:
|
||||
mkIf
|
||||
(if assertion then true else throw "\nFailed assertion: ${message}")
|
||||
content;
|
||||
|
||||
# Remove all "If" statement defined on a value.
|
||||
rmIf = foldProperty (
|
||||
foldFilter isIf
|
||||
|
|
Loading…
Reference in a new issue