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

Side by Side Diff: ios/chrome/common/ns_regular_expression_unittest.mm

Issue 2681353002: [ObjC ARC] Converts ios/chrome/common:unit_tests to ARC. (Closed)
Patch Set: comments Created 3 years, 10 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
« no previous file with comments | « ios/chrome/common/BUILD.gn ('k') | ios/chrome/common/string_util_unittest.mm » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/sys_string_conversions.h" 5 #include "base/strings/sys_string_conversions.h"
6 #import "testing/gtest_mac.h" 6 #import "testing/gtest_mac.h"
7 #include "testing/platform_test.h" 7 #include "testing/platform_test.h"
8 8
9 #if !defined(__has_feature) || !__has_feature(objc_arc)
10 #error "This file requires ARC support."
11 #endif
12
9 // Chromium code relies on NSRegularExpression class to match regular 13 // Chromium code relies on NSRegularExpression class to match regular
10 // expressions. Any subtle changes in behavior can lead to hard to diagnose 14 // expressions. Any subtle changes in behavior can lead to hard to diagnose
11 // problems. This files tests how NSRegularExpression handles various regular 15 // problems. This files tests how NSRegularExpression handles various regular
12 // expression features. 16 // expression features.
13 17
14 namespace { 18 namespace {
15 19
16 // Checks that capture groups from |testString| substituted into 20 // Checks that capture groups from |testString| substituted into
17 // |templateString| matches |expected|. 21 // |templateString| matches |expected|.
18 void ExpectRegexMatched(NSRegularExpression* regex, 22 void ExpectRegexMatched(NSRegularExpression* regex,
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 regex = MakeRegularExpression(@"^ab|cd|efghij$"); 128 regex = MakeRegularExpression(@"^ab|cd|efghij$");
125 ExpectRegexMatched(regex, @"ab", @"$0", @"ab"); 129 ExpectRegexMatched(regex, @"ab", @"$0", @"ab");
126 ExpectRegexMatched(regex, @"cd", @"$0", @"cd"); 130 ExpectRegexMatched(regex, @"cd", @"$0", @"cd");
127 ExpectRegexMatched(regex, @"efghij", @"$0", @"efghij"); 131 ExpectRegexMatched(regex, @"efghij", @"$0", @"efghij");
128 ExpectRegexNotMatched(regex, @"abcdefghij"); 132 ExpectRegexNotMatched(regex, @"abcdefghij");
129 ExpectRegexNotMatched(regex, @"abghij"); 133 ExpectRegexNotMatched(regex, @"abghij");
130 ExpectRegexNotMatched(regex, @"cdghij"); 134 ExpectRegexNotMatched(regex, @"cdghij");
131 } 135 }
132 136
133 } // namespace 137 } // namespace
OLDNEW
« no previous file with comments | « ios/chrome/common/BUILD.gn ('k') | ios/chrome/common/string_util_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698