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

Unified Diff: test/mjsunit/regexp.js

Issue 18654: Fix bug in RegExp parser. (Closed)
Patch Set: Added more tests. Created 11 years, 11 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 | « src/parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regexp.js
diff --git a/test/mjsunit/regexp.js b/test/mjsunit/regexp.js
index 4422211f2ccdc7b619c88f52df9ce1ce8eb87a14..716b54be049178fa4e991ff9d615aa031b4f1125 100644
--- a/test/mjsunit/regexp.js
+++ b/test/mjsunit/regexp.js
@@ -94,6 +94,22 @@ assertFalse(/\ca/.test( "\\ca" ));
//assertTrue(/\c[a/]/.test( "\x1ba/]" ));
+// Test \c in character class
+re = /^[\cM]$/;
+assertTrue(re.test("\r"));
+assertFalse(re.test("M"));
+assertFalse(re.test("c"));
+assertFalse(re.test("\\"));
+assertFalse(re.test("\x03")); // I.e., read as \cc
+
+re = /^[\c]]$/;
+assertTrue(re.test("c]"));
+assertFalse(re.test("\\]"));
+assertFalse(re.test("\x1d")); // ']' & 0x1f
+assertFalse(re.test("\\]"));
+assertFalse(re.test("\x03]")); // I.e., read as \cc
+
+
// Test that we handle \s and \S correctly inside some bizarre
// character classes.
re = /[\s-:]/;
« no previous file with comments | « src/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698