diff --git a/tests/functional/flakes/build-paths.sh b/tests/functional/flakes/build-paths.sh index ff012e1b3..98827947d 100644 --- a/tests/functional/flakes/build-paths.sh +++ b/tests/functional/flakes/build-paths.sh @@ -56,6 +56,18 @@ cat > $flake1Dir/flake.nix < \$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.) +nix build --json --no-link $flake1Dir#a14.foo | jq --exit-status ' + (.[0] | + (.drvPath | match(".*dot-installable.drv")) and + (.outputs | keys == ["foo"])) +' diff --git a/tests/functional/flakes/flakes.sh b/tests/functional/flakes/flakes.sh index f6931a578..427290883 100644 --- a/tests/functional/flakes/flakes.sh +++ b/tests/functional/flakes/flakes.sh @@ -285,35 +285,6 @@ git -C "$flake3Dir" add flake.lock git -C "$flake3Dir" commit -m 'Add lockfile' -# Test accessing output in installables with `.` (foobarbaz.) -cat > "$flake3Dir/flake.nix" < \$foo/file - echo "out" > \$out/file - ''; - outputSpecified = true; - }; - }; -} -EOF - -cp ../config.nix "$flake3Dir" -git -C "$flake3Dir" add flake.nix config.nix -git -C "$flake3Dir" commit -m 'multi outputs flake' - -nix build "$flake3Dir#hello.foo" --json --no-link | jq --exit-status ' - (.[0] | - (.drvPath | match(".*hello.drv")) and - (.outputs | keys == ["foo"])) -' - # Test whether registry caching works. nix registry list --flake-registry "file://$registry" | grepQuiet flake3 mv "$registry" "$registry.tmp"