diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lang/eval-okay-listtoattrs.exp | 1 | ||||
-rw-r--r-- | tests/lang/eval-okay-listtoattrs.nix (renamed from tests/lang/eval-okay-listToAttrs.nix) | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/tests/lang/eval-okay-listtoattrs.exp b/tests/lang/eval-okay-listtoattrs.exp new file mode 100644 index 000000000000..49adcc16f6ba --- /dev/null +++ b/tests/lang/eval-okay-listtoattrs.exp @@ -0,0 +1 @@ +Str("AA",[]) diff --git a/tests/lang/eval-okay-listToAttrs.nix b/tests/lang/eval-okay-listtoattrs.nix index f5eae92ccd98..d5cd726b0c64 100644 --- a/tests/lang/eval-okay-listToAttrs.nix +++ b/tests/lang/eval-okay-listtoattrs.nix @@ -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) |