From a0806389e909203d9c3c1c32a2cc95b50300da59 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 26 Feb 2014 18:40:08 +0100 Subject: Test the -b and -s flags of nix-store -q --- tests/user-envs.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') diff --git a/tests/user-envs.sh b/tests/user-envs.sh index b54c4776ff3e..c27b11ade1e2 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" ] -- cgit 1.4.1