diff --git a/tests/functional/flakes/dubious-query.sh b/tests/functional/flakes/dubious-query.sh new file mode 100644 index 000000000000..00ddc9891dbc --- /dev/null +++ b/tests/functional/flakes/dubious-query.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash + +source ./common.sh + +requireGit +clearStoreIfPossible + +nixpkgsDir="$TEST_ROOT/nixpkgs" +createGitRepo "$nixpkgsDir" +createSimpleGitFlake "$nixpkgsDir" +nix registry add --registry "$registry" nixpkgs "git+file://$nixpkgsDir" + +fooDrvPath="$(nix eval --raw "git+file://$nixpkgsDir#foo" --apply '(e: e.drvPath)')" + +# Check that a flakeref without a query is accepted correctly. +assertStderr "nix build --dry-run git+file://$nixpkgsDir#foo" <