forked from lix-project/lix
* Fix the broken test for listToAttrs.
This commit is contained in:
parent
13c2adc897
commit
f061086a93
1
tests/lang/eval-okay-listtoattrs.exp
Normal file
1
tests/lang/eval-okay-listtoattrs.exp
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Str("AA",[])
|
|
@ -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)
|
Loading…
Reference in a new issue