diff options
author | Robert Hensing <roberth@users.noreply.github.com> | 2023-08-04 17:00:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-04 17:00:46 +0200 |
commit | 8fa169707fa055994fe60f194027629fee8e417a (patch) | |
tree | 22e7bdef086799cabf7409ad5ce10c1327cafca4 /lib/path/tests | |
parent | 35184dd3a52239b91a1eea5e430fa35c32139161 (diff) | |
parent | 407db583c54245136fe8e73976abadb7eb9fad80 (diff) |
Merge pull request #242695 from tweag/lib.path.subpath.components
`lib.path.subpath.components`: init
Diffstat (limited to 'lib/path/tests')
-rw-r--r-- | lib/path/tests/unit.nix | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/path/tests/unit.nix b/lib/path/tests/unit.nix index 8bfb6f201219f..bad6560f13a98 100644 --- a/lib/path/tests/unit.nix +++ b/lib/path/tests/unit.nix @@ -238,6 +238,19 @@ let expr = (builtins.tryEval (subpath.normalise "..")).success; expected = false; }; + + testSubpathComponentsExample1 = { + expr = subpath.components "."; + expected = [ ]; + }; + testSubpathComponentsExample2 = { + expr = subpath.components "./foo//bar/./baz/"; + expected = [ "foo" "bar" "baz" ]; + }; + testSubpathComponentsExample3 = { + expr = (builtins.tryEval (subpath.components "/foo")).success; + expected = false; + }; }; in if cases == [] then "Unit tests successful" |