OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <sstream> | 5 #include <sstream> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 int result = FilePath::CompareIgnoreCase(s1, s2); | 1083 int result = FilePath::CompareIgnoreCase(s1, s2); |
1084 EXPECT_EQ(cases[i].expected, result) << | 1084 EXPECT_EQ(cases[i].expected, result) << |
1085 "i: " << i << ", s1: " << s1 << ", s2: " << s2; | 1085 "i: " << i << ", s1: " << s1 << ", s2: " << s2; |
1086 } | 1086 } |
1087 } | 1087 } |
1088 | 1088 |
1089 TEST_F(FilePathTest, ReferencesParent) { | 1089 TEST_F(FilePathTest, ReferencesParent) { |
1090 const struct UnaryBooleanTestData cases[] = { | 1090 const struct UnaryBooleanTestData cases[] = { |
1091 { FPL("."), false }, | 1091 { FPL("."), false }, |
1092 { FPL(".."), true }, | 1092 { FPL(".."), true }, |
1093 #if defined(OS_WIN) | |
1094 { FPL(".. "), true }, | 1093 { FPL(".. "), true }, |
1095 { FPL(" .."), true }, | 1094 { FPL(" .."), true }, |
1096 { FPL("..."), true }, | 1095 { FPL("..."), true }, |
1097 #else | |
1098 { FPL(".. "), false }, | |
1099 { FPL(" .."), false }, | |
1100 { FPL("..."), false }, | |
1101 #endif | |
1102 { FPL("a.."), false }, | 1096 { FPL("a.."), false }, |
1103 { FPL("..a"), false }, | 1097 { FPL("..a"), false }, |
1104 { FPL("../"), true }, | 1098 { FPL("../"), true }, |
1105 { FPL("/.."), true }, | 1099 { FPL("/.."), true }, |
1106 { FPL("/../"), true }, | 1100 { FPL("/../"), true }, |
1107 { FPL("/a../"), false }, | 1101 { FPL("/a../"), false }, |
1108 { FPL("/..a/"), false }, | 1102 { FPL("/..a/"), false }, |
1109 { FPL("//.."), true }, | 1103 { FPL("//.."), true }, |
1110 { FPL("..//"), true }, | 1104 { FPL("..//"), true }, |
1111 { FPL("//..//"), true }, | 1105 { FPL("//..//"), true }, |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1292 // Test the PrintTo overload for FilePath (used when a test fails to compare two | 1286 // Test the PrintTo overload for FilePath (used when a test fails to compare two |
1293 // FilePaths). | 1287 // FilePaths). |
1294 TEST_F(FilePathTest, PrintTo) { | 1288 TEST_F(FilePathTest, PrintTo) { |
1295 std::stringstream ss; | 1289 std::stringstream ss; |
1296 FilePath fp(FPL("foo")); | 1290 FilePath fp(FPL("foo")); |
1297 base::PrintTo(fp, &ss); | 1291 base::PrintTo(fp, &ss); |
1298 EXPECT_EQ("foo", ss.str()); | 1292 EXPECT_EQ("foo", ss.str()); |
1299 } | 1293 } |
1300 | 1294 |
1301 } // namespace base | 1295 } // namespace base |
OLD | NEW |