summary refs log tree commit diff
path: root/pkgs/lib/debug.nix
diff options
context:
space:
mode:
authorNicolas Pierron <nicolas.b.pierron@gmail.com>2009-06-26 12:42:00 +0000
committerNicolas Pierron <nicolas.b.pierron@gmail.com>2009-06-26 12:42:00 +0000
commitdd50af4923a71461262f3113022548edff545b79 (patch)
tree861809e1cc542e6023f419588b29fbf2f2cb2989 /pkgs/lib/debug.nix
parentc69010d6eb67db58aaf96aa40b0ae96dfc4dcbb7 (diff)
downloadnixpkgs-dd50af4923a71461262f3113022548edff545b79.tar
nixpkgs-dd50af4923a71461262f3113022548edff545b79.tar.gz
nixpkgs-dd50af4923a71461262f3113022548edff545b79.tar.bz2
nixpkgs-dd50af4923a71461262f3113022548edff545b79.tar.lz
nixpkgs-dd50af4923a71461262f3113022548edff545b79.tar.xz
nixpkgs-dd50af4923a71461262f3113022548edff545b79.tar.zst
nixpkgs-dd50af4923a71461262f3113022548edff545b79.zip
Add a description of values which cause a bad type the failure.
svn path=/nixpkgs/trunk/; revision=16054
Diffstat (limited to 'pkgs/lib/debug.nix')
-rw-r--r--pkgs/lib/debug.nix2
1 files changed, 2 insertions, 0 deletions
diff --git a/pkgs/lib/debug.nix b/pkgs/lib/debug.nix
index 18b5e1db9d4..c05f540e503 100644
--- a/pkgs/lib/debug.nix
+++ b/pkgs/lib/debug.nix
@@ -43,6 +43,8 @@ rec {
   traceCall2 = n : f : a : b : let t = n2 : x : traceShowValMarked "${n} ${n2}:" x; in t "result" (f (t "arg 1" a) (t "arg 2" b));
   traceCall3 = n : f : a : b : c : let t = n2 : x : traceShowValMarked "${n} ${n2}:" x; in t "result" (f (t "arg 1" a) (t "arg 2" b) (t "arg 3" c));
 
+  traceValIfNot = c: x:
+    if c x then true else trace (showVal x) false;
 
   /* Evaluate a set of tests.  A test is an attribute set {expr,
      expected}, denoting an expression and its expected result.  The