summaryrefslogtreecommitdiff
path: root/lib/path/tests
diff options
context:
space:
mode:
authorMikael Voss <mvs@nyantec.com>2025-03-13 12:57:06 +0100
committerMikael Voss <mvs@nyantec.com>2025-04-02 13:26:43 +0200
commitbf790d1a7fffcfd5c6a92711179d644119128a61 (patch)
tree18969afd6d67392a3dd18a0bc57bd9a97cb55dc7 /lib/path/tests
parentpolkadot: 2412-3 -> 2412-4 (#395145) (diff)
downloadnixpkgs-bf790d1a7fffcfd5c6a92711179d644119128a61.tar.gz
lib/path: properly handle /. in hasStorePathPrefix
Diffstat (limited to 'lib/path/tests')
-rw-r--r--lib/path/tests/unit.nix6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/path/tests/unit.nix b/lib/path/tests/unit.nix
index a52b4f44e51d..fa2e004e9c3a 100644
--- a/lib/path/tests/unit.nix
+++ b/lib/path/tests/unit.nix
@@ -110,6 +110,12 @@ let
expected = false;
};
+ # Root path (empty path components list)
+ testHasStorePathPrefixRoot = {
+ expr = hasStorePathPrefix /.;
+ expected = false;
+ };
+
testHasStorePathPrefixExample1 = {
expr = hasStorePathPrefix (storeDirPath + "/nvl9ic0pj1fpyln3zaqrf4cclbqdfn1j-foo/bar/baz");
expected = true;