diff options
author | Christian Theune <ct@flyingcircus.io> | 2015-05-19 20:03:36 +0200 |
---|---|---|
committer | Christian Theune <ct@flyingcircus.io> | 2015-05-19 20:03:36 +0200 |
commit | ea39c98d419a816029299b99f70455798e66f6b7 (patch) | |
tree | 9cdea14533783e93e0c7b1a4972bb6c58adb5edf /tests | |
parent | 3d8318870289d7b6b08677fcd2da6ceb0b082f8c (diff) |
Implement alternative to lazy generations:
* only the last generation can be lazy
* depend on the '--lazy-generation' flag to be set
Diffstat (limited to 'tests')
-rw-r--r-- | tests/user-envs.sh | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/user-envs.sh b/tests/user-envs.sh index ad15ddc3e..6b290e501 100644 --- a/tests/user-envs.sh +++ b/tests/user-envs.sh @@ -99,14 +99,24 @@ if nix-env -q '*' | grep -q bar; then false; fi nix-env --list-generations test "$(nix-env --list-generations | wc -l)" -eq 7 -# Doing the same operation twice should result in the same generation, not an -# additional one. At this point we just brought back foo. Installing it again -# should not create a new generation. +# Doing the same operation twice results in the same generation, but creates an +# additional one. At this point we just brought back foo. + nix-env -i foo # Count generations. nix-env --list-generations -test "$(nix-env --list-generations | wc -l)" -eq 7 +test "$(nix-env --list-generations | wc -l)" -eq 8 + +# Now, doing that again but passing the --lazy-generations flag will not +# create a new generation. + +nix-env -i foo --lazy-generation + +# Count generations. +nix-env --list-generations +test "$(nix-env --list-generations | wc -l)" -eq 8 + # Switch to a specified generation. nix-env --switch-generation 7 |