about summary refs log tree commit diff
path: root/src/libexpr/eval-test.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-04-14T23·25+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-04-14T23·25+0000
commitd39d3c6264707c466b21dfadd4d48653842a9156 (patch)
treeaf53c72ecf169d82bd501d49b71e8635b35252bd /src/libexpr/eval-test.cc
parent267dc693d2ca8dea13199f92c265fc35fdb047f6 (diff)
* Implemented inherit.
Diffstat (limited to 'src/libexpr/eval-test.cc')
-rw-r--r--src/libexpr/eval-test.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libexpr/eval-test.cc b/src/libexpr/eval-test.cc
index f87113e59704..a7786561e81e 100644
--- a/src/libexpr/eval-test.cc
+++ b/src/libexpr/eval-test.cc
@@ -105,9 +105,12 @@ void run(Strings args)
     doTest(state, "map (x: __add 1 x) [ 1 2 3 ]");
     doTest(state, "map (builtins.add 1) [ 1 2 3 ]");
     doTest(state, "builtins.hasAttr \"x\" { x = 1; }");
-    doTest(state, "let x = 1; as = rec { inherit x; y = as.x; }; in as.y");
+    doTest(state, "let x = 1; as = { inherit x; y = as.x; }; in as.y");
+    doTest(state, "let x = 1; as = rec { inherit x; y = x; }; in as.y");
     doTest(state, "let as = { x = 1; }; bs = rec { inherit (as) x; y = x; }; in bs.y");
     doTest(state, "let as = rec { inherit (y) x; y = { x = 1; }; }; in as.x");
+    doTest(state, "let x = 1; in let inherit x; in x");
+    doTest(state, "with { x = 1; }; let inherit x; y = x; in y");
     doTest(state, "builtins.toXML 123");
     doTest(state, "builtins.toXML { a.b = \"x\" + \"y\"; c = [ 1 2 ] ++ [ 3 4 ]; }");