1
0
Fork 1
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:
Nicolas Pierron 2011-03-30 11:18:10 +00:00
parent 56ade5fef2
commit 11472a0501

View file

@ -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