From 11bab3a5c4e44108d31fe6b1b703b0dd705cc4d1 Mon Sep 17 00:00:00 2001 From: "ager@chromium.org" Date: Thu, 14 Jan 2010 09:05:52 +0000 Subject: [PATCH] Fix the tests that change because of change to toISOString format. Review URL: http://codereview.chromium.org/543057 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3602 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- test/mjsunit/json.js | 6 +++--- test/mjsunit/mirror-date.js | 12 +++++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/test/mjsunit/json.js b/test/mjsunit/json.js index bf44f7814e..35e16340ce 100644 --- a/test/mjsunit/json.js +++ b/test/mjsunit/json.js @@ -65,9 +65,9 @@ assertEquals("tolf", (new String("tolf")).toJSON()); GenericToJSONChecks(String, "x", "y"); // Date toJSON -assertEquals("1970-01-01T00:00:00Z", new Date(0).toJSON()); -assertEquals("1979-01-11T08:00:00Z", new Date("1979-01-11 08:00 GMT").toJSON()); -assertEquals("2005-05-05T05:05:05Z", new Date("2005-05-05 05:05:05 GMT").toJSON()); +assertEquals("1970-01-01T00:00:00.000Z", new Date(0).toJSON()); +assertEquals("1979-01-11T08:00:00.000Z", new Date("1979-01-11 08:00 GMT").toJSON()); +assertEquals("2005-05-05T05:05:05.000Z", new Date("2005-05-05 05:05:05 GMT").toJSON()); var n1 = new Date(10000); n1.toISOString = function () { return "foo"; }; assertEquals("foo", n1.toJSON()); diff --git a/test/mjsunit/mirror-date.js b/test/mjsunit/mirror-date.js index 6b6a3ad407..5c113de261 100644 --- a/test/mjsunit/mirror-date.js +++ b/test/mjsunit/mirror-date.js @@ -57,7 +57,7 @@ function testDateMirror(d, iso8601) { // Test Date values. testDateMirror(new Date(Date.parse("Dec 25, 1995 1:30 UTC")), - "1995-12-25T01:30:00Z"); + "1995-12-25T01:30:00.000Z"); d = new Date(); d.setUTCFullYear(1967); d.setUTCMonth(0); // January. @@ -66,10 +66,12 @@ d.setUTCHours(9); d.setUTCMinutes(22); d.setUTCSeconds(59); d.setUTCMilliseconds(0); -testDateMirror(d, "1967-01-17T09:22:59Z"); +testDateMirror(d, "1967-01-17T09:22:59.000Z"); d.setUTCMilliseconds(1); -testDateMirror(d, "1967-01-17T09:22:59Z"); +testDateMirror(d, "1967-01-17T09:22:59.001Z"); d.setUTCSeconds(12); -testDateMirror(d, "1967-01-17T09:22:12Z"); +testDateMirror(d, "1967-01-17T09:22:12.001Z"); d.setUTCSeconds(36); -testDateMirror(d, "1967-01-17T09:22:36Z"); +testDateMirror(d, "1967-01-17T09:22:36.001Z"); +d.setUTCMilliseconds(136); +testDateMirror(d, "1967-01-17T09:22:36.136Z");