summary refs log tree commit diff
path: root/lib/tests
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2017-06-12 07:07:59 +0200
committerProfpatsch <mail@profpatsch.de>2017-06-22 00:58:59 +0200
commit5cbc6ca9bb63f939dab2c2c82a63d72f1f30d9b7 (patch)
tree3e80385ca7d970dfca11cafe12be51e6ec0f08ec /lib/tests
parentfeb8cbdc38c6b10b2c66a96151d8d560e960c29f (diff)
downloadnixlib-5cbc6ca9bb63f939dab2c2c82a63d72f1f30d9b7.tar
nixlib-5cbc6ca9bb63f939dab2c2c82a63d72f1f30d9b7.tar.gz
nixlib-5cbc6ca9bb63f939dab2c2c82a63d72f1f30d9b7.tar.bz2
nixlib-5cbc6ca9bb63f939dab2c2c82a63d72f1f30d9b7.tar.lz
nixlib-5cbc6ca9bb63f939dab2c2c82a63d72f1f30d9b7.tar.xz
nixlib-5cbc6ca9bb63f939dab2c2c82a63d72f1f30d9b7.tar.zst
nixlib-5cbc6ca9bb63f939dab2c2c82a63d72f1f30d9b7.zip
lib/generators: put more information in toPretty lambdas
With `builtins.functionArgs` we can get some information if the first argument
is an attrset and whether the contained fields have default values. Encode that
into the pretty-printed lambda.
Diffstat (limited to 'lib/tests')
-rw-r--r--lib/tests/misc.nix2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/tests/misc.nix b/lib/tests/misc.nix
index f40036274e81..4c4c06fe78da 100644
--- a/lib/tests/misc.nix
+++ b/lib/tests/misc.nix
@@ -292,6 +292,7 @@ runTests {
       string = "fnord";
       null_ = null;
       function = x: x;
+      functionArgs = { arg ? 4, foo }: arg;
       list = [ 3 4 function [ false ] ];
       attrs = { foo = null; "foo bar" = "baz"; };
       drv = derivation { name = "test"; system = builtins.currentSystem; };
@@ -302,6 +303,7 @@ runTests {
       string = "\"fnord\"";
       null_ = "null";
       function = "<λ>";
+      functionArgs = "<λ:{(arg),foo}>";
       list = "[ 3 4 ${function} [ false ] ]";
       attrs = "{ \"foo\" = null; \"foo bar\" = \"baz\"; }";
       drv = "<δ>";