Test the delayed with a bit more

This commit is contained in:
Eelco Dolstra 2013-07-31 13:12:35 +02:00
parent 0a470fc345
commit 7df4ef983e
3 changed files with 8 additions and 5 deletions

View file

@ -40,7 +40,7 @@ for i in lang/eval-okay-*.nix; do
if test -e lang/$i.flags; then
flags=$(cat lang/$i.flags)
fi
if ! NIX_PATH=lang/dir3:lang/dir4:$NIX_PATH nix-instantiate $flags --eval-only --strict lang/$i.nix > lang/$i.out; then
if ! NIX_PATH=lang/dir3:lang/dir4_PATH nix-instantiate $flags --eval-only --strict lang/$i.nix > lang/$i.out; then
echo "FAIL: $i should evaluate"
fail=1
elif ! diff lang/$i.out lang/$i.exp; then

View file

@ -1 +1 @@
"b-overridden"
"b-overridden b-overridden a"

View file

@ -1,4 +1,5 @@
let
pkgs_ = with pkgs; {
a = derivation {
name = "a";
@ -13,14 +14,16 @@ let
system = builtins.currentSystem;
builder = "/bin/sh";
args = [ "-c" "touch $out" ];
inherit a;
};
c = b;
};
packageOverrides = p: {
b = derivation (p.b.drvAttrs // { name = "b-overridden"; });
packageOverrides = pkgs: with pkgs; {
b = derivation (b.drvAttrs // { name = "${b.name}-overridden"; });
};
pkgs = pkgs_ // (packageOverrides pkgs_);
in pkgs.a.b.name
in "${pkgs.a.b.name} ${pkgs.c.name} ${pkgs.b.a.name}"