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

Unified Diff: test/cctest/test-regexp.cc

Issue 48061: Remapped regexp last-match-info to put subject and index before match indices. (Closed)
Patch Set: Created 11 years, 9 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 side-by-side diff with in-line comments
Download patch
« src/regexp-delay.js ('K') | « src/v8natives.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-regexp.cc
diff --git a/test/cctest/test-regexp.cc b/test/cctest/test-regexp.cc
index 50fe8625e1a79017d276d5e17db52f3d0656f476..11055c7ff1f07bf04d543f4ce9a8d8c2af77a0d5 100644
--- a/test/cctest/test-regexp.cc
+++ b/test/cctest/test-regexp.cc
@@ -641,18 +641,22 @@ TEST(MacroAssembler) {
Handle<ByteArray> array = Handle<ByteArray>::cast(m.GetCode(source));
int captures[5];
- Handle<String> f1 =
- Factory::NewStringFromAscii(CStrVector("foobar"));
- CHECK(IrregexpInterpreter::Match(array, f1, captures, 0));
+ const uc16 str1[] = {'f', 'o', 'o', 'b', 'a', 'r'};
+ Handle<String> f1_16 =
+ Factory::NewStringFromTwoByte(Vector<const uc16>(str1, 6));
+
+ CHECK(IrregexpInterpreter::Match(array, f1_16, captures, 0));
CHECK_EQ(0, captures[0]);
CHECK_EQ(3, captures[1]);
CHECK_EQ(1, captures[2]);
CHECK_EQ(2, captures[3]);
CHECK_EQ(84, captures[4]);
- Handle<String> f2 =
- Factory::NewStringFromAscii(CStrVector("barfoo"));
- CHECK(!IrregexpInterpreter::Match(array, f2, captures, 0));
+ const uc16 str2[] = {'b', 'a', 'r', 'f', 'o', 'o'};
+ Handle<String> f2_16 =
+ Factory::NewStringFromTwoByte(Vector<const uc16>(str2, 6));
+
+ CHECK(!IrregexpInterpreter::Match(array, f2_16, captures, 0));
CHECK_EQ(42, captures[0]);
}
« src/regexp-delay.js ('K') | « src/v8natives.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698