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

Unified Diff: test/mjsunit/es7/regexp-ui-word.js

Issue 2725583002: [regexp] fix /\W/ui wrt \u017f and \u212a. (Closed)
Patch Set: address comments Created 3 years, 10 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/regexp/regexp-parser.cc ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es7/regexp-ui-word.js
diff --git a/test/mjsunit/es7/regexp-ui-word.js b/test/mjsunit/es7/regexp-ui-word.js
new file mode 100644
index 0000000000000000000000000000000000000000..6b04fb4c32d66d450b717333c2d50deb5501bbe9
--- /dev/null
+++ b/test/mjsunit/es7/regexp-ui-word.js
@@ -0,0 +1,42 @@
+// Copyright 2017 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+assertTrue(/\w/iu.test('\u017F'));
+assertTrue(/\w/iu.test('\u212A'));
+assertFalse(/\W/iu.test('\u017F'));
+assertFalse(/\W/iu.test('\u212A'));
+assertFalse(/\W/iu.test('s'));
+assertFalse(/\W/iu.test('S'));
+assertFalse(/\W/iu.test('K'));
+assertFalse(/\W/iu.test('k'));
+
+assertTrue(/[\w]/iu.test('\u017F'));
+assertTrue(/[\w]/iu.test('\u212A'));
+assertFalse(/[\W]/iu.test('\u017F'));
+assertFalse(/[\W]/iu.test('\u212A'));
+assertFalse(/[\W]/iu.test('s'));
+assertFalse(/[\W]/iu.test('S'));
+assertFalse(/[\W]/iu.test('K'));
+assertFalse(/[\W]/iu.test('k'));
+
+assertTrue(/\b/iu.test('\u017F'));
+assertTrue(/\b/iu.test('\u212A'));
+assertTrue(/\b/iu.test('s'));
+assertTrue(/\b/iu.test('S'));
+assertFalse(/\B/iu.test('\u017F'));
+assertFalse(/\B/iu.test('\u212A'));
+assertFalse(/\B/iu.test('s'));
+assertFalse(/\B/iu.test('S'));
+assertFalse(/\B/iu.test('K'));
+assertFalse(/\B/iu.test('k'));
+
+assertEquals(["abcd", "d"], /a.*?(.)\b/i.exec('abcd\u017F cd'));
+assertEquals(["abcd", "d"], /a.*?(.)\b/i.exec('abcd\u212A cd'));
+assertEquals(["abcd\u017F", "\u017F"], /a.*?(.)\b/iu.exec('abcd\u017F cd'));
+assertEquals(["abcd\u212A", "\u212A"], /a.*?(.)\b/iu.exec('abcd\u212A cd'));
+
+assertEquals(["a\u017F ", " "], /a.*?\B(.)/i.exec('a\u017F '));
+assertEquals(["a\u212A ", " "], /a.*?\B(.)/i.exec('a\u212A '));
+assertEquals(["a\u017F", "\u017F"], /a.*?\B(.)/iu.exec('a\u017F '));
+assertEquals(["a\u212A", "\u212A"], /a.*?\B(.)/iu.exec('a\u212A '));
« no previous file with comments | « src/regexp/regexp-parser.cc ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698