forked from lix-project/lix
Enable baseNameOf
test
Add note about removal of trailing slashes in the doc comment of baseNameOf and enabled the test.
This commit is contained in:
parent
e3df9c2a6e
commit
2191141274
|
@ -127,11 +127,9 @@ namespace nix {
|
||||||
ASSERT_EQ(p1, "");
|
ASSERT_EQ(p1, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX: according to the doc of `baseNameOf`, baseNameOf("/dir/") should return
|
TEST(baseNameOf, trailingSlash) {
|
||||||
// "" but it actually returns "dir"
|
|
||||||
TEST(baseNameOf, DISABLED_trailingSlash) {
|
|
||||||
auto p1 = baseNameOf("/dir/");
|
auto p1 = baseNameOf("/dir/");
|
||||||
ASSERT_EQ(p1, "");
|
ASSERT_EQ(p1, "dir");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------------
|
/* ----------------------------------------------------------------------------
|
||||||
|
|
|
@ -63,7 +63,7 @@ Path canonPath(const Path & path, bool resolveSymlinks = false);
|
||||||
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
|
||||||
following the final `/'. */
|
following the final `/' (trailing slashes are removed). */
|
||||||
std::string_view baseNameOf(std::string_view path);
|
std::string_view baseNameOf(std::string_view path);
|
||||||
|
|
||||||
/* Check whether 'path' is a descendant of 'dir'. */
|
/* Check whether 'path' is a descendant of 'dir'. */
|
||||||
|
|
Loading…
Reference in a new issue