From 10e806bceff6edd5e70147b1e77e1d3ddd0cd167 Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Sun, 22 Nov 2009 21:28:46 +0000 Subject: [PATCH] testAllTrue helper function svn path=/nixpkgs/trunk/; revision=18540 --- pkgs/lib/debug.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/lib/debug.nix b/pkgs/lib/debug.nix index 25ca733951a..d4d2702a284 100644 --- a/pkgs/lib/debug.nix +++ b/pkgs/lib/debug.nix @@ -71,7 +71,9 @@ rec { then [ { inherit name; expected = test.expected; result = test.expr; } ] else [] ) tests)); - + # create a test assuming that list elements are true + # usage: { testX = allTrue [ true ]; } + testAllTrue = expr : { inherit expr; expected = map (x: true) expr; }; # evaluate everything once so that errors will occur earlier # hacky: traverse attrs by adding a dummy