diff --git a/tests/user-envs.sh b/tests/user-envs.sh index b54c4776ff..c27b11ade1 100644 --- a/tests/user-envs.sh +++ b/tests/user-envs.sh @@ -1,5 +1,6 @@ source common.sh +clearStore clearProfiles set -x @@ -32,6 +33,17 @@ test "$(nix-env -q '*' | wc -l)" -eq 1 nix-env -q '*' | grep -q foo-1.0 test "$($profiles/test/bin/foo)" = "foo-1.0" +# Test nix-env -qc to compare installed against available packages, and vice versa. +nix-env -qc '*' | grep -q '< 2.0' +nix-env -qac '*' | grep -q '> 1.0' + +# Test the -b flag to filter out source-only packages. +[ "$(nix-env -qab | wc -l)" -eq 1 ] + +# Test the -s flag to get package status. +nix-env -qas | grep -q 'IP- foo-1.0' +nix-env -qas | grep -q -- '--- bar-0.1' + # Disable foo. nix-env --set-flag active false foo ! [ -e "$profiles/test/bin/foo" ]