From 2629998e9167b2d7897a2f34a6f531affc4033db Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Sat, 18 Aug 2007 22:12:00 +0000 Subject: primop functions listToAttrs (+test), __isAttrs, __trace added new configuration style proposal in lib/default-unstable.nix --- tests/lang/eval-okay-listToAttrs.nix | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 tests/lang/eval-okay-listToAttrs.nix (limited to 'tests/lang/eval-okay-listToAttrs.nix') diff --git a/tests/lang/eval-okay-listToAttrs.nix b/tests/lang/eval-okay-listToAttrs.nix new file mode 100644 index 000000000000..f5eae92ccd98 --- /dev/null +++ b/tests/lang/eval-okay-listToAttrs.nix @@ -0,0 +1,8 @@ +# this test shows how to use listToAttrs and that evaluation is still lazy (throw isn't called) +let + asi = attr: value : { inherit attr value; }; + list = [ ( asi "a" "A" ) ( asi "b" "B" ) ]; + a = builtins.listToAttrs list; + b = builtins.listToAttrs ( list ++ list ); + r = builtins.listToAttrs [ (asi "result" [ a b ]) ( asi "throw" (throw "this should not be thrown")) ]; +in r.result -- cgit 1.4.1