about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-02-26T17·40+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-02-26T17·40+0100
commita0806389e909203d9c3c1c32a2cc95b50300da59 (patch)
tree70d81a4b345253d80badca983967d26c68839bb8 /tests
parenta9c4a987705b00a6d5e98e0ad7cc44c8bc96ba22 (diff)
Test the -b and -s flags of nix-store -q
Diffstat (limited to 'tests')
-rw-r--r--tests/user-envs.sh12
1 files changed, 12 insertions, 0 deletions
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" ]