OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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-unicode-regexps --harmony-regexp-lookbehind | 5 // Flags: --harmony-regexp-lookbehind |
6 | 6 |
7 function execl(expectation, regexp, subject) { | 7 function execl(expectation, regexp, subject) { |
8 if (regexp instanceof String) regexp = new RegExp(regexp, "u"); | 8 if (regexp instanceof String) regexp = new RegExp(regexp, "u"); |
9 assertEquals(expectation, regexp.exec(subject)); | 9 assertEquals(expectation, regexp.exec(subject)); |
10 } | 10 } |
11 | 11 |
12 function execs(expectation, regexp_source, subject) { | 12 function execs(expectation, regexp_source, subject) { |
13 execl(expectation, new RegExp(regexp_source, "u"), subject); | 13 execl(expectation, new RegExp(regexp_source, "u"), subject); |
14 } | 14 } |
15 | 15 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 tests(true, "...(?<=" + L + ")", X + T + L); | 149 tests(true, "...(?<=" + L + ")", X + T + L); |
150 tests(false, "...(?<=" + T + ")", X + L + T) | 150 tests(false, "...(?<=" + T + ")", X + L + T) |
151 tests(true, "..(?<=" + L + T + ")", X + L + T) | 151 tests(true, "..(?<=" + L + T + ")", X + L + T) |
152 tests(true, "..(?<=" + L + T + "(?<=" + L + T + "))", X + L + T); | 152 tests(true, "..(?<=" + L + T + "(?<=" + L + T + "))", X + L + T); |
153 tests(false, "..(?<=" + L + "(" + T + "))", X + L + T); | 153 tests(false, "..(?<=" + L + "(" + T + "))", X + L + T); |
154 tests(false, ".*" + L, X + L + T); | 154 tests(false, ".*" + L, X + L + T); |
155 tests(true, ".*" + L, X + L + L + T); | 155 tests(true, ".*" + L, X + L + L + T); |
156 tests(false, ".*" + L, X + L + T + L + T); | 156 tests(false, ".*" + L, X + L + T + L + T); |
157 tests(false, ".*" + T, X + L + T + L + T); | 157 tests(false, ".*" + T, X + L + T + L + T); |
158 tests(true, ".*" + T, X + L + T + T + L + T); | 158 tests(true, ".*" + T, X + L + T + T + L + T); |
OLD | NEW |