mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-09 15:58:05 +02:00
addFlag: test that alias flags are allowed
This commit is contained in:
parent
74dccef004
commit
d54dfbf879
2 changed files with 16 additions and 0 deletions
|
@ -140,6 +140,18 @@ nix build --impure -f multiple-outputs.nix --json e --no-link | jq --exit-status
|
|||
(.outputs | keys == ["a_a", "b"]))
|
||||
'
|
||||
|
||||
# Make sure that the 3 types of aliases work
|
||||
# BaseSettings<T>, BaseSettings<bool>, and BaseSettings<SandboxMode>.
|
||||
nix build --impure -f multiple-outputs.nix --json e --no-link \
|
||||
--build-max-jobs 3 \
|
||||
--gc-keep-outputs \
|
||||
--build-use-sandbox | \
|
||||
jq --exit-status '
|
||||
(.[0] |
|
||||
(.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")'
|
||||
|
|
|
@ -58,3 +58,7 @@ fi
|
|||
# Test that unknown settings are warned about
|
||||
out="$(expectStderr 0 nix eval --option foobar baz --expr '""' --raw)"
|
||||
[[ "$(echo "$out" | grep foobar | wc -l)" = 1 ]]
|
||||
|
||||
# Test flag alias
|
||||
out="$(nix eval --expr '{}' --build-cores 1)"
|
||||
[[ "$(echo "$out" | wc -l)" = 1 ]]
|
||||
|
|
Loading…
Reference in a new issue