| Index: test/webkit/fast/regex/malformed-escapes.js
|
| diff --git a/test/webkit/dfg-min-max.js b/test/webkit/fast/regex/malformed-escapes.js
|
| similarity index 56%
|
| copy from test/webkit/dfg-min-max.js
|
| copy to test/webkit/fast/regex/malformed-escapes.js
|
| index da47ca2abcec07ef0f22596ffd0a90e6031269a8..bf03683ab512b8b924f263efa42c439a16d0c40a 100644
|
| --- a/test/webkit/dfg-min-max.js
|
| +++ b/test/webkit/fast/regex/malformed-escapes.js
|
| @@ -22,44 +22,49 @@
|
| // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| description(
|
| -"This tests that Math.min and Math.max for doubles works correctly in the DFG JIT."
|
| +"This page tests handling of malformed escape sequences."
|
| );
|
|
|
| -function doMin(a, b) {
|
| - return Math.min(a, b);
|
| -}
|
| +var regexp;
|
|
|
| -function doMax(a, b) {
|
| - return Math.max(a, b);
|
| -}
|
| +regexp = /\ug/gm;
|
| +debug("\nTesting regexp: " + regexp);
|
| +shouldBeTrue("regexp.test('ug')");
|
| +shouldBe("regexp.lastIndex", "2");
|
|
|
| -for (var i = 0; i < 1000; ++i) {
|
| - doMin(1.5, 2.5);
|
| - doMax(1.5, 2.5);
|
| -}
|
| +regexp = /\xg/gm;
|
| +debug("\nTesting regexp: " + regexp);
|
| +shouldBeTrue("regexp.test('xg')");
|
| +shouldBe("regexp.lastIndex", "2");
|
|
|
| -shouldBe("doMin(1.5, 2.5)", "1.5");
|
| -shouldBe("doMin(2.5, 1.5)", "1.5");
|
| -shouldBe("doMin(1.5, 1.5)", "1.5");
|
| -shouldBe("doMin(2.5, 2.5)", "2.5");
|
| +regexp = /\c_/gm;
|
| +debug("\nTesting regexp: " + regexp);
|
| +shouldBeTrue("regexp.test('\\\\c_')");
|
| +shouldBe("regexp.lastIndex", "3");
|
|
|
| -shouldBe("doMin(1.5, NaN)", "NaN");
|
| -shouldBe("doMin(2.5, NaN)", "NaN");
|
| -shouldBe("doMin(NaN, 1.5)", "NaN");
|
| -shouldBe("doMin(NaN, 2.5)", "NaN");
|
| +regexp = /[\B]/gm;
|
| +debug("\nTesting regexp: " + regexp);
|
| +shouldBeTrue("regexp.test('B')");
|
| +shouldBe("regexp.lastIndex", "1");
|
|
|
| -shouldBe("doMin(NaN, NaN)", "NaN");
|
| +regexp = /[\b]/gm;
|
| +debug("\nTesting regexp: " + regexp);
|
| +shouldBeTrue("regexp.test('\\b')");
|
| +shouldBe("regexp.lastIndex", "1");
|
|
|
| -shouldBe("doMax(1.5, 2.5)", "2.5");
|
| -shouldBe("doMax(2.5, 1.5)", "2.5");
|
| -shouldBe("doMax(1.5, 1.5)", "1.5");
|
| -shouldBe("doMax(2.5, 2.5)", "2.5");
|
| +regexp = /\8/gm;
|
| +debug("\nTesting regexp: " + regexp);
|
| +shouldBeTrue("regexp.test('\\\\8')");
|
| +shouldBe("regexp.lastIndex", "2");
|
|
|
| -shouldBe("doMax(1.5, NaN)", "NaN");
|
| -shouldBe("doMax(2.5, NaN)", "NaN");
|
| -shouldBe("doMax(NaN, 1.5)", "NaN");
|
| -shouldBe("doMax(NaN, 2.5)", "NaN");
|
| +regexp = /^[\c]$/;
|
| +debug("\nTesting regexp: " + regexp);
|
| +shouldBeTrue("regexp.test('c')");
|
|
|
| -shouldBe("doMax(NaN, NaN)", "NaN");
|
| +regexp = /^[\c_]$/;
|
| +debug("\nTesting regexp: " + regexp);
|
| +shouldBeFalse("regexp.test('c')");
|
|
|
| -var successfullyParsed = true;
|
| +regexp = /^[\c]]$/;
|
| +debug("\nTesting regexp: " + regexp);
|
| +shouldBeTrue("regexp.test('c]')");
|
|
|