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

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

Issue 11206: Info propagation. (Closed)
Patch Set: Created 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/jsregexp.cc ('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 853d4f47108d5be1a49161cefb04d409812c3293..4b41309c18617a113060119a7a112aef822d13d6 100644
--- a/test/cctest/test-regexp.cc
+++ b/test/cctest/test-regexp.cc
@@ -334,17 +334,23 @@ TEST(CharacterClassEscapes) {
}
-static void Execute(const char* input,
- const char* str,
- bool dot_output = false) {
- v8::HandleScope scope;
+static RegExpNode* Compile(const char* input) {
unibrow::Utf8InputBuffer<> buffer(input, strlen(input));
- ZoneScope zone_scope(DELETE_ON_EXIT);
RegExpParseResult result;
if (!v8::internal::ParseRegExp(&buffer, &result))
- return;
+ return NULL;
RegExpNode* node = NULL;
RegExpEngine::Compile(&result, &node, false);
+ return node;
+}
+
+
+static void Execute(const char* input,
+ const char* str,
+ bool dot_output = false) {
+ v8::HandleScope scope;
+ ZoneScope zone_scope(DELETE_ON_EXIT);
+ RegExpNode* node = Compile(input);
USE(node);
#ifdef DEBUG
if (dot_output) {
@@ -755,6 +761,14 @@ TEST(LatinCanonicalize) {
}
+TEST(SimplePropagation) {
+ v8::HandleScope scope;
+ ZoneScope zone_scope(DELETE_ON_EXIT);
+ RegExpNode* node = Compile("(a|^b|c)");
+ CHECK(node->info()->determine_start);
+}
+
+
TEST(Graph) {
- Execute("fo[ob]ar|[ba]z|x[yz]*", "", true);
+ Execute("(a|^b|c)", "", true);
}
« no previous file with comments | « src/jsregexp.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698