aboutsummaryrefslogtreecommitdiff
path: root/tests/nix-profile.sh
diff options
context:
space:
mode:
authorEli Kogan-Wang <elikowa@gmail.com>2022-05-11 12:15:08 +0200
committerEli Kogan-Wang <elikowa@gmail.com>2022-05-11 12:16:35 +0200
commitaefc6c4f41bfac0c76807c234fd0a786dd40f140 (patch)
tree4e56e4d651ca1aa5d46a141b84311792754670dd /tests/nix-profile.sh
parent54457382f948bff30e2879a7d9047616e134ac5b (diff)
Add priority for nix profile install
Diffstat (limited to 'tests/nix-profile.sh')
-rw-r--r--tests/nix-profile.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/nix-profile.sh b/tests/nix-profile.sh
index f8da3d929..1cc724483 100644
--- a/tests/nix-profile.sh
+++ b/tests/nix-profile.sh
@@ -120,3 +120,19 @@ nix profile install "$flake1Dir^man"
(! [ -e $TEST_HOME/.nix-profile/bin/hello ])
[ -e $TEST_HOME/.nix-profile/share/man ]
(! [ -e $TEST_HOME/.nix-profile/include ])
+
+# test priority
+nix profile remove 0
+
+# Make another flake.
+flake2Dir=$TEST_ROOT/flake2
+printf World > $flake1Dir/who
+cp -r $flake1Dir $flake2Dir
+printf World2 > $flake2Dir/who
+
+nix profile install $flake1Dir
+[[ $($TEST_HOME/.nix-profile/bin/hello) = "Hello World" ]]
+nix profile install $flake2Dir --priority 100
+[[ $($TEST_HOME/.nix-profile/bin/hello) = "Hello World" ]]
+nix profile install $flake2Dir --priority 0
+[[ $($TEST_HOME/.nix-profile/bin/hello) = "Hello World2" ]]