mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 14:06:16 +02:00
profile: add tests for not matching any packages
This commit is contained in:
parent
9fac62435c
commit
fb391ebc77
1 changed files with 16 additions and 0 deletions
|
@ -77,6 +77,18 @@ nix profile upgrade --regex '.*'
|
||||||
[[ $(readlink $TEST_HOME/.nix-profile/bin/hello) =~ .*-profile-test-2\.1/bin/hello ]]
|
[[ $(readlink $TEST_HOME/.nix-profile/bin/hello) =~ .*-profile-test-2\.1/bin/hello ]]
|
||||||
nix profile rollback
|
nix profile rollback
|
||||||
|
|
||||||
|
# Test matching no packages using literal package name.
|
||||||
|
assertStderr nix --offline profile upgrade this_package_is_not_installed << EOF
|
||||||
|
warning: Package name 'this_package_is_not_installed' does not match any packages in the profile.
|
||||||
|
warning: No packages to upgrade. Use 'nix profile list' to see the current profile.
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Test matching no packages using regular expression.
|
||||||
|
assertStderr nix --offline profile upgrade --regex '.*unknown_package.*' << EOF
|
||||||
|
warning: Regex '.*unknown_package.*' does not match any packages in the profile.
|
||||||
|
warning: No packages to upgrade. Use 'nix profile list' to see the current profile.
|
||||||
|
EOF
|
||||||
|
|
||||||
# Test removing all packages using regular expression.
|
# Test removing all packages using regular expression.
|
||||||
nix profile remove --regex '.*' 2>&1 | grep "removed 2 packages, kept 0 packages"
|
nix profile remove --regex '.*' 2>&1 | grep "removed 2 packages, kept 0 packages"
|
||||||
nix profile rollback
|
nix profile rollback
|
||||||
|
@ -85,6 +97,10 @@ nix profile rollback
|
||||||
nix profile diff-closures
|
nix profile diff-closures
|
||||||
|
|
||||||
# Test rollback.
|
# Test rollback.
|
||||||
|
printf World > $flake1Dir/who
|
||||||
|
nix profile upgrade flake1
|
||||||
|
printf NixOS > $flake1Dir/who
|
||||||
|
nix profile upgrade flake1
|
||||||
nix profile rollback
|
nix profile rollback
|
||||||
[[ $($TEST_HOME/.nix-profile/bin/hello) = "Hello World" ]]
|
[[ $($TEST_HOME/.nix-profile/bin/hello) = "Hello World" ]]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue