Add more tests for Path::isAbsolute

This commit is contained in:
amai2012 2018-04-19 14:35:26 +02:00
parent 57019c0128
commit e256ce8ea8
1 changed files with 3 additions and 1 deletions

View File

@ -82,6 +82,8 @@ private:
ASSERT_EQUALS(false, Path::isAbsolute("foo.cpp")); ASSERT_EQUALS(false, Path::isAbsolute("foo.cpp"));
ASSERT_EQUALS(false, Path::isAbsolute("C:foo.cpp")); ASSERT_EQUALS(false, Path::isAbsolute("C:foo.cpp"));
ASSERT_EQUALS(false, Path::isAbsolute("C:foo\\bar.cpp")); ASSERT_EQUALS(false, Path::isAbsolute("C:foo\\bar.cpp"));
ASSERT_EQUALS(false, Path::isAbsolute("bar.cpp"));
TODO_ASSERT_EQUALS(true, false, Path::isAbsolute("\\"));
#else #else
ASSERT_EQUALS(true, Path::isAbsolute("/foo/bar")); ASSERT_EQUALS(true, Path::isAbsolute("/foo/bar"));
ASSERT_EQUALS(true, Path::isAbsolute("/")); ASSERT_EQUALS(true, Path::isAbsolute("/"));
@ -91,7 +93,7 @@ private:
} }
void getRelative() const { void getRelative() const {
std::vector<std::string> basePaths = { const std::vector<std::string> basePaths = {
"", // Don't crash with empty paths "", // Don't crash with empty paths
"C:/foo", "C:/foo",
"C:/bar/", "C:/bar/",