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 | Merge pull request #246036 from ck3d/vdr-updates-2023-07 (diff) | |
| parent | lib/path/README.md: Justify returning subpaths (diff) | |
| download | nixpkgs-8fa169707fa055994fe60f194027629fee8e417a.tar.gz | |
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 8bfb6f201219..bad6560f13a9 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" |
