* Fix the broken test for listToAttrs.

This commit is contained in:
Eelco Dolstra 2010-03-31 13:35:29 +00:00
parent 13c2adc897
commit f061086a93
2 changed files with 5 additions and 2 deletions

View file

@ -0,0 +1 @@
Str("AA",[])

View file

@ -1,8 +1,10 @@
# this test shows how to use listToAttrs and that evaluation is still lazy (throw isn't called) # this test shows how to use listToAttrs and that evaluation is still lazy (throw isn't called)
with import ./lib.nix;
let let
asi = attr: value : { inherit attr value; }; asi = name: value : { inherit name value; };
list = [ ( asi "a" "A" ) ( asi "b" "B" ) ]; list = [ ( asi "a" "A" ) ( asi "b" "B" ) ];
a = builtins.listToAttrs list; a = builtins.listToAttrs list;
b = builtins.listToAttrs ( list ++ list ); b = builtins.listToAttrs ( list ++ list );
r = builtins.listToAttrs [ (asi "result" [ a b ]) ( asi "throw" (throw "this should not be thrown")) ]; r = builtins.listToAttrs [ (asi "result" [ a b ]) ( asi "throw" (throw "this should not be thrown")) ];
in r.result in concat (map (x: x.a) r.result)