Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Side by Side Diff: base/file_path_unittest.cc

Issue 10872072: foo (1).user.js, not foo.user (1).js. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: grump Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/file_path.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/file_path.h" 6 #include "base/file_path.h"
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "testing/platform_test.h" 10 #include "testing/platform_test.h"
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 { FPL("/foo.tar.tar.gz"), FPL(".tar.gz") }, 746 { FPL("/foo.tar.tar.gz"), FPL(".tar.gz") },
747 { FPL("/foo.tar.gz.gz"), FPL(".gz.gz") }, 747 { FPL("/foo.tar.gz.gz"), FPL(".gz.gz") },
748 { FPL("."), FPL("") }, 748 { FPL("."), FPL("") },
749 { FPL(".."), FPL("") }, 749 { FPL(".."), FPL("") },
750 { FPL("./foo"), FPL("") }, 750 { FPL("./foo"), FPL("") },
751 { FPL("./foo.ext"), FPL(".ext") }, 751 { FPL("./foo.ext"), FPL(".ext") },
752 { FPL("/foo.ext1/bar.ext2"), FPL(".ext2") }, 752 { FPL("/foo.ext1/bar.ext2"), FPL(".ext2") },
753 { FPL("/foo.bar////"), FPL(".bar") }, 753 { FPL("/foo.bar////"), FPL(".bar") },
754 { FPL("/foo.bar/.."), FPL("") }, 754 { FPL("/foo.bar/.."), FPL("") },
755 { FPL("/foo.bar/..////"), FPL("") }, 755 { FPL("/foo.bar/..////"), FPL("") },
756 { FPL("/foo.1234.user.js"), FPL(".user.js") },
757 { FPL("foo.user.js"), FPL(".user.js") },
758 { FPL("/foo.1234.luser.js"), FPL(".js") },
759 { FPL("/user.js"), FPL(".js") },
756 }; 760 };
757 for (unsigned int i = 0; i < arraysize(cases); ++i) { 761 for (unsigned int i = 0; i < arraysize(cases); ++i) {
758 FilePath path(cases[i].input); 762 FilePath path(cases[i].input);
759 FilePath::StringType extension = path.Extension(); 763 FilePath::StringType extension = path.Extension();
760 EXPECT_STREQ(cases[i].expected, extension.c_str()) << "i: " << i << 764 EXPECT_STREQ(cases[i].expected, extension.c_str()) << "i: " << i <<
761 ", path: " << path.value(); 765 ", path: " << path.value();
762 } 766 }
763 } 767 }
764 768
765 TEST_F(FilePathTest, InsertBeforeExtension) { 769 TEST_F(FilePathTest, InsertBeforeExtension) {
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
1148 }; 1152 };
1149 for (size_t i = 0; i < arraysize(cases); ++i) { 1153 for (size_t i = 0; i < arraysize(cases); ++i) {
1150 FilePath input(cases[i].input); 1154 FilePath input(cases[i].input);
1151 FilePath observed = input.NormalizePathSeparators(); 1155 FilePath observed = input.NormalizePathSeparators();
1152 EXPECT_EQ(FilePath::StringType(cases[i].expected), observed.value()) << 1156 EXPECT_EQ(FilePath::StringType(cases[i].expected), observed.value()) <<
1153 "i: " << i << ", input: " << input.value(); 1157 "i: " << i << ", input: " << input.value();
1154 } 1158 }
1155 } 1159 }
1156 1160
1157 #endif 1161 #endif
OLDNEW
« no previous file with comments | « base/file_path.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698