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

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

Issue 10872010: Reland regexp global optimizations. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/test-regexp.cc ('k') | test/mjsunit/regexp-global.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-strings.cc
diff --git a/test/cctest/test-strings.cc b/test/cctest/test-strings.cc
index c4f72f47010342fedc3c2fd4e042faf0fe649a1a..4557100e7ab1d1ec288d1135d0986ffb8264093c 100644
--- a/test/cctest/test-strings.cc
+++ b/test/cctest/test-strings.cc
@@ -1,4 +1,4 @@
-// Copyright 2011 the V8 project authors. All rights reserved.
+// Copyright 2012 the V8 project authors. All rights reserved.
// Check that we can traverse very deep stacks of ConsStrings using
// StringInputBuffer. Check that Get(int) works on very deep stacks
@@ -691,3 +691,20 @@ TEST(RegExpOverflow) {
CHECK(result.IsEmpty());
CHECK(context->HasOutOfMemoryException());
}
+
+
+TEST(StringReplaceAtomTwoByteResult) {
+ InitializeVM();
+ HandleScope scope;
+ LocalContext context;
+ v8::Local<v8::Value> result = CompileRun(
+ "var subject = 'ascii~only~string~'; "
+ "var replace = '\x80'; "
+ "subject.replace(/~/g, replace); ");
+ CHECK(result->IsString());
+ Handle<String> string = v8::Utils::OpenHandle(v8::String::Cast(*result));
+ CHECK(string->IsSeqTwoByteString());
+
+ v8::Local<v8::String> expected = v8_str("ascii\x80only\x80string\x80");
+ CHECK(expected->Equals(result));
+}
« no previous file with comments | « test/cctest/test-regexp.cc ('k') | test/mjsunit/regexp-global.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698