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

Side by Side Diff: base/strings/pattern_unittest.cc

Issue 1466413002: Update gtest to 786564fa4a3c, switch to googlemock in gtest Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « base/strings/nullable_string16_unittest.cc ('k') | base/strings/safe_sprintf_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/strings/pattern.h" 5 #include "base/strings/pattern.h"
6 #include "base/strings/utf_string_conversions.h" 6 #include "base/strings/utf_string_conversions.h"
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/googletest/include/gtest/gtest.h"
8 8
9 namespace base { 9 namespace base {
10 10
11 TEST(StringUtilTest, MatchPatternTest) { 11 TEST(StringUtilTest, MatchPatternTest) {
12 EXPECT_TRUE(MatchPattern("www.google.com", "*.com")); 12 EXPECT_TRUE(MatchPattern("www.google.com", "*.com"));
13 EXPECT_TRUE(MatchPattern("www.google.com", "*")); 13 EXPECT_TRUE(MatchPattern("www.google.com", "*"));
14 EXPECT_FALSE(MatchPattern("www.google.com", "www*.g*.org")); 14 EXPECT_FALSE(MatchPattern("www.google.com", "www*.g*.org"));
15 EXPECT_TRUE(MatchPattern("Hello", "H?l?o")); 15 EXPECT_TRUE(MatchPattern("Hello", "H?l?o"));
16 EXPECT_FALSE(MatchPattern("www.google.com", "http://*)")); 16 EXPECT_FALSE(MatchPattern("www.google.com", "http://*)"));
17 EXPECT_FALSE(MatchPattern("www.msn.com", "*.COM")); 17 EXPECT_FALSE(MatchPattern("www.msn.com", "*.COM"));
(...skipping 23 matching lines...) Expand all
41 UTF8ToUTF16("He??o\\*1*"))); 41 UTF8ToUTF16("He??o\\*1*")));
42 42
43 // This test verifies that consecutive wild cards are collapsed into 1 43 // This test verifies that consecutive wild cards are collapsed into 1
44 // wildcard (when this doesn't occur, MatchPattern reaches it's maximum 44 // wildcard (when this doesn't occur, MatchPattern reaches it's maximum
45 // recursion depth). 45 // recursion depth).
46 EXPECT_TRUE(MatchPattern(UTF8ToUTF16("Hello"), 46 EXPECT_TRUE(MatchPattern(UTF8ToUTF16("Hello"),
47 UTF8ToUTF16("He********************************o"))); 47 UTF8ToUTF16("He********************************o")));
48 } 48 }
49 49
50 } // namespace base 50 } // namespace base
OLDNEW
« no previous file with comments | « base/strings/nullable_string16_unittest.cc ('k') | base/strings/safe_sprintf_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698