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

Side by Side Diff: test/mjsunit/harmony/regexp-lookbehind.js

Issue 1522353002: [regexp] break recursion in mutually recursive capture/back references. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: new test expectations Created 5 years 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 unified diff | Download patch
« no previous file with comments | « test/cctest/test-regexp.cc ('k') | test/mjsunit/regexp.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Flags: --harmony-regexp-lookbehind 5 // Flags: --harmony-regexp-lookbehind
6 6
7 // Simple fixed-length matches. 7 // Simple fixed-length matches.
8 assertEquals(["a"], "a".match(/^.(?<=a)/)); 8 assertEquals(["a"], "a".match(/^.(?<=a)/));
9 assertNull("b".match(/^.(?<=a)/)); 9 assertNull("b".match(/^.(?<=a)/));
10 assertEquals(["foo"], "foo1".match(/^f..(?<=.oo)/)); 10 assertEquals(["foo"], "foo1".match(/^f..(?<=.oo)/));
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 assertEquals(["fno"], "fno".match(/^f.o(?<!foo)$/)); 150 assertEquals(["fno"], "fno".match(/^f.o(?<!foo)$/));
151 assertEquals(["foooo"], "foooo".match(/^foooo(?<=fo+)$/)); 151 assertEquals(["foooo"], "foooo".match(/^foooo(?<=fo+)$/));
152 assertEquals(["foooo"], "foooo".match(/^foooo(?<=fo*)$/)); 152 assertEquals(["foooo"], "foooo".match(/^foooo(?<=fo*)$/));
153 assertEquals(["abc", "abc"], /(abc\1)/.exec("abc")); 153 assertEquals(["abc", "abc"], /(abc\1)/.exec("abc"));
154 assertEquals(["abc", "abc"], /(abc\1)/.exec("abc\u1234")); 154 assertEquals(["abc", "abc"], /(abc\1)/.exec("abc\u1234"));
155 assertEquals(["abc", "abc"], /(abc\1)/i.exec("abc")); 155 assertEquals(["abc", "abc"], /(abc\1)/i.exec("abc"));
156 assertEquals(["abc", "abc"], /(abc\1)/i.exec("abc\u1234")); 156 assertEquals(["abc", "abc"], /(abc\1)/i.exec("abc\u1234"));
157 var oob_subject = "abcdefghijklmnabcdefghijklmn".substr(14); 157 var oob_subject = "abcdefghijklmnabcdefghijklmn".substr(14);
158 assertNull(oob_subject.match(/(?=(abcdefghijklmn))(?<=\1)a/i)); 158 assertNull(oob_subject.match(/(?=(abcdefghijklmn))(?<=\1)a/i));
159 assertNull(oob_subject.match(/(?=(abcdefghijklmn))(?<=\1)a/)); 159 assertNull(oob_subject.match(/(?=(abcdefghijklmn))(?<=\1)a/));
160
161 // Mutual recursive capture/back references
162 assertEquals(["cacb", "a", ""], /(?<=a(.\2)b(\1)).{4}/.exec("aabcacbc"));
163 assertEquals(["b", "ac", "ac"], /(?<=a(\2)b(..\1))b/.exec("aacbacb"));
164 assertEquals(["x", "aa"], /(?<=(?:\1b)(aa))./.exec("aabaax"));
165 assertEquals(["x", "aa"], /(?<=(?:\1|b)(aa))./.exec("aaaax"));
OLDNEW
« no previous file with comments | « test/cctest/test-regexp.cc ('k') | test/mjsunit/regexp.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698