Write test, will fail until rest of PR

This commit is contained in:
John Ericson 2023-01-16 19:10:18 -05:00
parent e37f436eb4
commit 1b6c96bbcb
2 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,23 @@
source common.sh
# Without flakes, flake options should not show up
# With flakes, flake options should show up
function both_ways {
nix --experimental-features 'nix-command' "$@" | grepQuietInverse flake
nix --experimental-features 'nix-command flakes' "$@" | grepQuiet flake
# Also, the order should not matter
nix "$@" --experimental-features 'nix-command' | grepQuietInverse flake
nix "$@" --experimental-features 'nix-command flakes' | grepQuiet flake
}
# Simple case, the configuration effects the running command
both_ways show-config
# Complicated case, earlier args effect later args
both_ways store gc --help
expect 1 nix --experimental-features 'nix-command' show-config --flake-registry 'https://no'
nix --experimental-features 'nix-command flakes' show-config --flake-registry 'https://no'

View file

@ -18,6 +18,7 @@ nix_tests = \
gc.sh \ gc.sh \
remote-store.sh \ remote-store.sh \
lang.sh \ lang.sh \
experimental-features.sh \
fetchMercurial.sh \ fetchMercurial.sh \
gc-auto.sh \ gc-auto.sh \
user-envs.sh \ user-envs.sh \