aboutsummaryrefslogtreecommitdiff
path: root/tests/lang
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lang')
-rw-r--r--tests/lang/eval-okay-listtoattrs.exp1
-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 000000000..49adcc16f
--- /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 f5eae92cc..d5cd726b0 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)