diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2010-04-12T21·21+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2010-04-12T21·21+0000 |
commit | a60317f20fbc8be8e339060d932946f6d99ece6a (patch) | |
tree | b6cd2cc61fb904fafc7527f2a776cdb6b0e9c179 /src/libexpr/eval-test.cc | |
parent | 4d6ad5be1738c64b1de4274cafbd4b8f23ca287c (diff) |
* More missing constructs.
Diffstat (limited to 'src/libexpr/eval-test.cc')
-rw-r--r-- | src/libexpr/eval-test.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libexpr/eval-test.cc b/src/libexpr/eval-test.cc index 32f4940df90e..dd8ead04a68f 100644 --- a/src/libexpr/eval-test.cc +++ b/src/libexpr/eval-test.cc @@ -45,6 +45,7 @@ void run(Strings args) doTest(state, "({x, y, ...}@args: args.z) { x = 1; y = 2; z = 3; }"); //doTest(state, "({x ? y, y ? x}: y) { }"); doTest(state, "let x = 1; in x"); + doTest(state, "let { x = 1; body = x; }"); doTest(state, "with { x = 1; }; x"); doTest(state, "let x = 2; in with { x = 1; }; x"); // => 2 doTest(state, "with { x = 1; }; with { x = 2; }; x"); // => 1 @@ -65,18 +66,19 @@ void run(Strings args) doTest(state, "__head [ 1 2 3 ]"); doTest(state, "__add 1 2"); doTest(state, "null"); - //doTest(state, "\"foo\""); - //doTest(state, "let s = \"bar\"; in \"foo${s}\""); + doTest(state, "\"foo\""); + doTest(state, "let s = \"bar\"; in \"foo${s}\""); doTest(state, "if true then 1 else 2"); doTest(state, "if false then 1 else 2"); doTest(state, "if false || true then 1 else 2"); + doTest(state, "!(true || false)"); doTest(state, "let x = x; in if true || x then 1 else 2"); doTest(state, "http://nixos.org/"); doTest(state, "/etc/passwd"); //doTest(state, "import ./foo.nix"); 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, "builtins.hasAttr \"x\" { x = 1; }"); doTest(state, "let x = 1; as = rec { inherit x; y = as.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"); |