diff options
author | Silvan Mosberger <silvan.mosberger@tweag.io> | 2023-07-10 21:16:25 +0200 |
---|---|---|
committer | Silvan Mosberger <silvan.mosberger@tweag.io> | 2023-07-26 23:29:44 +0200 |
commit | 4e14f5fee6a68ee5fb56d07e70e86fcfcebdc7d3 (patch) | |
tree | 1b2e71f9b1e938afd03230f31c9d45e246ea989f /lib/path/tests | |
parent | 4dc542d80149a284637a46df2a1f2e4b066cd219 (diff) |
lib.path.subpath.components: init
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
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 9c5b752cf64a3..fc5a84493adb3 100644 --- a/lib/path/tests/unit.nix +++ b/lib/path/tests/unit.nix @@ -204,6 +204,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" |