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
1 changed files with 5 additions and 0 deletions

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