mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
lib.path.subpath.components: init
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user