mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 22:16:16 +02:00
Enable dirOf
test
Adjusted the doc comment for `dirOf` to reflect the implementation behavior.
This commit is contained in:
parent
5b8883faac
commit
e3df9c2a6e
2 changed files with 4 additions and 6 deletions
|
@ -86,12 +86,10 @@ namespace nix {
|
||||||
* dirOf
|
* dirOf
|
||||||
* --------------------------------------------------------------------------*/
|
* --------------------------------------------------------------------------*/
|
||||||
|
|
||||||
// XXX: according to the doc of `dirOf`, dirOf("/") and dirOf("/foo")
|
TEST(dirOf, returnsEmptyStringForRoot) {
|
||||||
// should both return "" but it actually returns "/" in both cases
|
|
||||||
TEST(dirOf, DISABLED_returnsEmptyStringForRoot) {
|
|
||||||
auto p = dirOf("/");
|
auto p = dirOf("/");
|
||||||
|
|
||||||
ASSERT_EQ(p, "");
|
ASSERT_EQ(p, "/");
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(dirOf, returnsFirstPathComponent) {
|
TEST(dirOf, returnsFirstPathComponent) {
|
||||||
|
|
|
@ -58,8 +58,8 @@ Path canonPath(const Path & path, bool resolveSymlinks = false);
|
||||||
|
|
||||||
/* Return the directory part of the given canonical path, i.e.,
|
/* Return the directory part of the given canonical path, i.e.,
|
||||||
everything before the final `/'. If the path is the root or an
|
everything before the final `/'. If the path is the root or an
|
||||||
immediate child thereof (e.g., `/foo'), this means an empty string
|
immediate child thereof (e.g., `/foo'), this means `/'
|
||||||
is returned. */
|
is returned.*/
|
||||||
Path dirOf(const Path & path);
|
Path dirOf(const Path & path);
|
||||||
|
|
||||||
/* Return the base name of the given canonical path, i.e., everything
|
/* Return the base name of the given canonical path, i.e., everything
|
||||||
|
|
Loading…
Reference in a new issue