mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
Add some tests for illegal output names
This commit is contained in:
parent
95cfd50d25
commit
1ebfa6ba2d
3 changed files with 15 additions and 2 deletions
|
@ -89,7 +89,7 @@ nix build "$drv^first,second" --no-link --json | jq --exit-status '
|
||||||
(.outputs |
|
(.outputs |
|
||||||
(keys | length == 2) and
|
(keys | length == 2) and
|
||||||
(.first | match(".*multiple-outputs-a-first")) and
|
(.first | match(".*multiple-outputs-a-first")) and
|
||||||
(.second | match(".*multiple-outputs-a-second"))))
|
(.second | match(".*multiple-outputs-a-second"))))
|
||||||
'
|
'
|
||||||
|
|
||||||
nix build "$drv^*" --no-link --json | jq --exit-status '
|
nix build "$drv^*" --no-link --json | jq --exit-status '
|
||||||
|
@ -98,7 +98,7 @@ nix build "$drv^*" --no-link --json | jq --exit-status '
|
||||||
(.outputs |
|
(.outputs |
|
||||||
(keys | length == 2) and
|
(keys | length == 2) and
|
||||||
(.first | match(".*multiple-outputs-a-first")) and
|
(.first | match(".*multiple-outputs-a-first")) and
|
||||||
(.second | match(".*multiple-outputs-a-second"))))
|
(.second | match(".*multiple-outputs-a-second"))))
|
||||||
'
|
'
|
||||||
|
|
||||||
# Make sure that `--impure` works (regression test for https://github.com/NixOS/nix/issues/6488)
|
# Make sure that `--impure` works (regression test for https://github.com/NixOS/nix/issues/6488)
|
||||||
|
|
|
@ -117,4 +117,14 @@ rec {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
invalid-output-name-1 = mkDerivation {
|
||||||
|
name = "invalid-output-name-1";
|
||||||
|
outputs = [ "out/"];
|
||||||
|
};
|
||||||
|
|
||||||
|
invalid-output-name-2 = mkDerivation {
|
||||||
|
name = "invalid-output-name-2";
|
||||||
|
outputs = [ "x" "foo$"];
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,3 +83,6 @@ nix-store --gc --keep-derivations --keep-outputs
|
||||||
nix-store --gc --print-roots
|
nix-store --gc --print-roots
|
||||||
rm -rf $NIX_STORE_DIR/.links
|
rm -rf $NIX_STORE_DIR/.links
|
||||||
rmdir $NIX_STORE_DIR
|
rmdir $NIX_STORE_DIR
|
||||||
|
|
||||||
|
nix build -f multiple-outputs.nix invalid-output-name-1 2>&1 | grep 'contains illegal character'
|
||||||
|
nix build -f multiple-outputs.nix invalid-output-name-2 2>&1 | grep 'contains illegal character'
|
||||||
|
|
Loading…
Reference in a new issue