From 53c15336b06dcf26689c35fb3166ca6a4846b967 Mon Sep 17 00:00:00 2001 From: Tharun T Date: Mon, 25 Mar 2024 07:43:31 +0530 Subject: [PATCH] derivation output selection test --- tests/functional/flakes/flakes.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) 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"