mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
* Fix the broken test for listToAttrs.
This commit is contained in:
parent
13c2adc897
commit
f061086a93
2 changed files with 5 additions and 2 deletions
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)
|
||||
with import ./lib.nix;
|
||||
|
||||
let
|
||||
asi = attr: value : { inherit attr value; };
|
||||
asi = name: value : { inherit name 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
|
||||
in concat (map (x: x.a) r.result)
|
Loading…
Reference in a new issue