Index: test/webkit/fast/regex/ecma-regex-examples.js |
diff --git a/test/webkit/dfg-patchable-get-by-id-after-watchpoint.js b/test/webkit/fast/regex/ecma-regex-examples.js |
similarity index 55% |
copy from test/webkit/dfg-patchable-get-by-id-after-watchpoint.js |
copy to test/webkit/fast/regex/ecma-regex-examples.js |
index 9866126ef09bafb7ca15f1b9a595ecb5f96a6215..70ecb6bc219eba92f50c53ea48f8e48952230cdd 100644 |
--- a/test/webkit/dfg-patchable-get-by-id-after-watchpoint.js |
+++ b/test/webkit/fast/regex/ecma-regex-examples.js |
@@ -22,49 +22,41 @@ |
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
description( |
-"This tests that a patchable GetById right after a watchpoint has the appropriate nop padding." |
+"This page tests the regex examples from the ECMA-262 specification." |
); |
-function foo(o, p) { |
- var a = p.f; |
- var b = o.f; // Watchpoint. |
- var c = p.g; // Patchable GetById. |
- return b(a + c); |
-} |
+var regex01 = /a|ab/; |
+shouldBe('regex01.exec("abc")', '["a"]'); |
-function O() { |
-} |
+var regex02 = /((a)|(ab))((c)|(bc))/; |
+shouldBe('regex02.exec("abc")', '["abc", "a", "a", undefined, "bc", undefined, "bc"]'); |
-O.prototype.f = function(x) { return x + 1; }; |
+var regex03 = /a[a-z]{2,4}/; |
+shouldBe('regex03.exec("abcdefghi")', '["abcde"]'); |
-var o = new O(); |
+var regex04 = /a[a-z]{2,4}?/; |
+shouldBe('regex04.exec("abcdefghi")', '["abc"]'); |
-function P1() { |
-} |
+var regex05 = /(aa|aabaac|ba|b|c)*/; |
+shouldBe('regex05.exec("aabaac")', '["aaba", "ba"]'); |
-P1.prototype.g = 42; |
+var regex06 = /^(a+)\1*,\1+$/; |
+shouldBe('"aaaaaaaaaa,aaaaaaaaaaaaaaa".replace(regex06,"$1")', '"aaaaa"'); |
-function P2() { |
-} |
+var regex07 = /(z)((a+)?(b+)?(c))*/; |
+shouldBe('regex07.exec("zaacbbbcac")', '["zaacbbbcac", "z", "ac", "a", undefined, "c"]'); |
-P2.prototype.g = 24; |
+var regex08 = /(a*)*/; |
+shouldBe('regex08.exec("b")', '["", undefined]'); |
-var p1 = new P1(); |
-var p2 = new P2(); |
+var regex09 = /(a*)b\1+/; |
+shouldBe('regex09.exec("baaaac")', '["b", ""]'); |
-p1.f = 1; |
-p2.f = 2; |
+var regex10 = /(?=(a+))/; |
+shouldBe('regex10.exec("baaabac")', '["", "aaa"]'); |
-for (var i = 0; i < 200; ++i) { |
- var p = (i % 2) ? p1 : p2; |
- var expected = (i % 2) ? 44 : 27; |
- if (i == 150) { |
- // Cause first the watchpoint on o.f to fire, and then the GetById |
- // to be reset. |
- O.prototype.g = 57; // Fire the watchpoint. |
- P1.prototype.h = 58; // Reset the GetById. |
- P2.prototype.h = 59; // Not necessary, but what the heck - this resets the GetById even more. |
- } |
- shouldBe("foo(o, p)", "" + expected); |
-} |
+var regex11 = /(?=(a+))a*b\1/; |
+shouldBe('regex11.exec("baaabac")', '["aba", "a"]'); |
+var regex12 = /(.*?)a(?!(a+)b\2c)\2(.*)/; |
+shouldBe('regex12.exec("baaabaac")', '["baaabaac", "ba", undefined, "abaac"]'); |