about summary refs log tree commit diff
path: root/tests/user-envs.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/user-envs.sh')
-rw-r--r--tests/user-envs.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/user-envs.sh b/tests/user-envs.sh
index ab445a8ee9fc..0d997acd69d9 100644
--- a/tests/user-envs.sh
+++ b/tests/user-envs.sh
@@ -86,7 +86,9 @@ if nix-env -q '*' | grep -q foo; then false; fi
 nix-env -q '*' | grep -q bar
 
 # Rollback: should bring "foo" back.
+oldGen="$(nix-store -q --resolve $profiles/test)"
 nix-env --rollback
+[ "$(nix-store -q --resolve $profiles/test)" != "$oldGen" ]
 nix-env -q '*' | grep -q foo-2.0
 nix-env -q '*' | grep -q bar
 
@@ -99,6 +101,10 @@ if nix-env -q '*' | grep -q bar; then false; fi
 nix-env --list-generations
 test "$(nix-env --list-generations | wc -l)" -eq 7
 
+# Switch to a specified generation.
+nix-env --switch-generation 7
+[ "$(nix-store -q --resolve $profiles/test)" = "$oldGen" ]
+
 # Install foo-1.0, now using its store path.
 nix-env -i "$outPath10"
 nix-env -q '*' | grep -q foo-1.0