diff --git a/tests/functional/flakes/flakes.sh b/tests/functional/flakes/flakes.sh index 427290883..f6931a578 100644 --- a/tests/functional/flakes/flakes.sh +++ b/tests/functional/flakes/flakes.sh @@ -285,6 +285,35 @@ 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"