1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-08 06:53:54 +02:00

move test to correct file

This commit is contained in:
Tharun T 2024-03-28 02:20:33 +05:30
parent 53c15336b0
commit 52359ca00a
2 changed files with 19 additions and 29 deletions

View file

@ -56,6 +56,18 @@ cat > $flake1Dir/flake.nix <<EOF
a12 = self.drvCall.outPath;
a13 = "\${self.drvCall.drvPath}\${self.drvCall.outPath}";
a14 = with import ./config.nix; mkDerivation {
name = "dot-installable";
outputs = [ "foo" "out" ];
meta.outputsToInstall = [ "out" ];
buildCommand = ''
mkdir \$foo \$out
echo "foo" > \$foo/file
echo "out" > \$out/file
'';
outputSpecified = true;
};
};
}
EOF
@ -94,3 +106,10 @@ nix build --json --out-link $TEST_ROOT/result $flake1Dir#a12
expectStderr 1 nix build --impure --json --out-link $TEST_ROOT/result $flake1Dir#a13 \
| grepQuiet "has 2 entries in its context. It should only have exactly one entry"
# Test accessing output in installables with `.` (foobarbaz.<output>)
nix build --json --no-link $flake1Dir#a14.foo | jq --exit-status '
(.[0] |
(.drvPath | match(".*dot-installable.drv")) and
(.outputs | keys == ["foo"]))
'