OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
6 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRegularExpression.
h" | 6 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRegularExpression.
h" |
7 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" | 7 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextCaseSensitivit
y.h" | 8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextCaseSensitivit
y.h" |
9 | 9 |
10 using WebKit::WebRegularExpression; | 10 using WebKit::WebRegularExpression; |
11 using WebKit::WebString; | 11 using WebKit::WebString; |
12 using WebKit::WebTextCaseInsensitive; | 12 using WebKit::WebTextCaseInsensitive; |
13 using WebKit::WebTextCaseSensitive; | 13 using WebKit::WebTextCaseSensitive; |
14 using WebKit::WebUChar; | 14 using WebKit::WebUChar; |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 100 |
101 testMatches(regex, matches, arraysize(matches)); | 101 testMatches(regex, matches, arraysize(matches)); |
102 } | 102 } |
103 | 103 |
104 TEST(RegexTest, EmptyMatch) { | 104 TEST(RegexTest, EmptyMatch) { |
105 WebRegularExpression regex("|x", WebTextCaseInsensitive); | 105 WebRegularExpression regex("|x", WebTextCaseInsensitive); |
106 int matchedLength = 0; | 106 int matchedLength = 0; |
107 EXPECT_EQ(0, regex.match("", 0, &matchedLength)); | 107 EXPECT_EQ(0, regex.match("", 0, &matchedLength)); |
108 EXPECT_EQ(0, matchedLength); | 108 EXPECT_EQ(0, matchedLength); |
109 } | 109 } |
OLD | NEW |