diff options
author | Nico Weber <nicolasweber@gmx.de> | 2016-02-02 23:20:01 (GMT) |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2016-02-02 23:20:01 (GMT) |
commit | f1f3f494f5f67a4cd64b0cddaad472b070f6db07 (patch) | |
tree | eeb623655e1ac45cb471508dcbf8568a1e26bf81 /src/util_test.cc | |
parent | 35e950d4c2d97d21ef7adf27cf6d003827e908ed (diff) | |
parent | 5b910df397c6937552a6f3dee600da69c49702e2 (diff) | |
download | Ninja-f1f3f494f5f67a4cd64b0cddaad472b070f6db07.zip Ninja-f1f3f494f5f67a4cd64b0cddaad472b070f6db07.tar.gz Ninja-f1f3f494f5f67a4cd64b0cddaad472b070f6db07.tar.bz2 |
Merge pull request #1076 from colincross/canonicalize
Canonicalize "." to "."
Diffstat (limited to 'src/util_test.cc')
-rw-r--r-- | src/util_test.cc | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/util_test.cc b/src/util_test.cc index 8ca7f56..33a4107 100644 --- a/src/util_test.cc +++ b/src/util_test.cc @@ -91,6 +91,22 @@ TEST(CanonicalizePath, PathSamples) { path = "/"; EXPECT_TRUE(CanonicalizePath(&path, &err)); EXPECT_EQ("", path); + + path = "/foo/.."; + EXPECT_TRUE(CanonicalizePath(&path, &err)); + EXPECT_EQ("", path); + + path = "."; + EXPECT_TRUE(CanonicalizePath(&path, &err)); + EXPECT_EQ(".", path); + + path = "./."; + EXPECT_TRUE(CanonicalizePath(&path, &err)); + EXPECT_EQ(".", path); + + path = "foo/.."; + EXPECT_TRUE(CanonicalizePath(&path, &err)); + EXPECT_EQ(".", path); } #ifdef _WIN32 @@ -288,22 +304,6 @@ TEST(CanonicalizePath, TooManyComponents) { } #endif -TEST(CanonicalizePath, EmptyResult) { - string path; - string err; - - EXPECT_FALSE(CanonicalizePath(&path, &err)); - EXPECT_EQ("empty path", err); - - path = "."; - EXPECT_FALSE(CanonicalizePath(&path, &err)); - EXPECT_EQ("path canonicalizes to the empty path", err); - - path = "./."; - EXPECT_FALSE(CanonicalizePath(&path, &err)); - EXPECT_EQ("path canonicalizes to the empty path", err); -} - TEST(CanonicalizePath, UpDir) { string path, err; path = "../../foo/bar.h"; |