test: add test for non-defaulting for stding installable input

This commit is contained in:
Tom Bereknyei 2023-06-12 08:40:17 -04:00
parent 08089fdd32
commit 0e3849dc65
2 changed files with 5 additions and 1 deletions

View file

@ -701,7 +701,7 @@ RawInstallablesCommand::RawInstallablesCommand()
{
addFlag({
.longName = "stdin",
.description = "Read installables from the standard input.",
.description = "Read installables from the standard input. No default installable applied.",
.handler = {&readFromStdIn, true}
});

View file

@ -129,3 +129,7 @@ nix build --impure -f multiple-outputs.nix --json e --no-link | jq --exit-status
(.drvPath | match(".*multiple-outputs-e.drv")) and
(.outputs | keys == ["a_a", "b"]))
'
# Make sure that `--stdin` works and does not apply any defaults
printf "" | nix build --no-link --stdin --json | jq --exit-status '. == []'
printf "%s\n" "$drv^*" | nix build --no-link --stdin --json | jq --exit-status '.[0]|has("drvPath")'