Drop unnecessary std::string

This commit is contained in:
Tobias Pflug 2020-05-07 19:29:10 +02:00
parent 1f3602a2c9
commit 73d0b5d807

View file

@ -111,29 +111,29 @@ namespace nix {
TEST(baseNameOf, emptyPath) { TEST(baseNameOf, emptyPath) {
auto p1 = baseNameOf(""); auto p1 = baseNameOf("");
ASSERT_EQ(std::string(p1), ""); ASSERT_EQ(p1, "");
} }
TEST(baseNameOf, pathOnRoot) { TEST(baseNameOf, pathOnRoot) {
auto p1 = baseNameOf("/dir"); auto p1 = baseNameOf("/dir");
ASSERT_EQ(std::string(p1), "dir"); ASSERT_EQ(p1, "dir");
} }
TEST(baseNameOf, relativePath) { TEST(baseNameOf, relativePath) {
auto p1 = baseNameOf("dir/foo"); auto p1 = baseNameOf("dir/foo");
ASSERT_EQ(std::string(p1), "foo"); ASSERT_EQ(p1, "foo");
} }
TEST(baseNameOf, pathWithTrailingSlashRoot) { TEST(baseNameOf, pathWithTrailingSlashRoot) {
auto p1 = baseNameOf("/"); auto p1 = baseNameOf("/");
ASSERT_EQ(std::string(p1), ""); ASSERT_EQ(p1, "");
} }
// XXX: according to the doc of `baseNameOf`, baseNameOf("/dir/") should return // XXX: according to the doc of `baseNameOf`, baseNameOf("/dir/") should return
// "" but it actually returns "dir" // "" but it actually returns "dir"
TEST(baseNameOf, DISABLED_trailingSlash) { TEST(baseNameOf, DISABLED_trailingSlash) {
auto p1 = baseNameOf("/dir/"); auto p1 = baseNameOf("/dir/");
ASSERT_EQ(std::string(p1), ""); ASSERT_EQ(p1, "");
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------