Changeset 10198 in webkit for trunk/JavaScriptCore/tests
- Timestamp:
- Aug 15, 2005, 1:37:10 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/tests/mozilla/ecma_3/Date/15.9.5.5.js
r5172 r10198 28 28 portion of the Date in the current time zone in a convenient, 29 29 human-readable form. We can't test the content of the string, 30 but can verify that the string is parsable by Date.parse30 but can verify that the object returned is a string. 31 31 32 32 The toLocaleString function is not generic; it generates a runtime error … … 68 68 addTestCase(); 69 69 70 // Date.parse is accurate to the second; valueOf() to the millisecond -71 status = "Math.abs(Date.parse(now.toLocaleString()) - now.valueOf()) < 1000";72 actual = Math.abs(Date.parse(now.toLocaleString()) - now.valueOf()) < 1000;73 expect = true;74 addTestCase();75 76 77 78 // 197079 addDateTestCase(0);80 addDateTestCase(TZ_ADJUST);81 82 83 // 190084 addDateTestCase(TIME_1900);85 addDateTestCase(TIME_1900 -TZ_ADJUST);86 87 88 // 200089 addDateTestCase(TIME_2000);90 addDateTestCase(TIME_2000 -TZ_ADJUST);91 92 93 // 29 Feb 200094 addDateTestCase(UTC_29_FEB_2000);95 addDateTestCase(UTC_29_FEB_2000 - 1000);96 addDateTestCase(UTC_29_FEB_2000 - TZ_ADJUST);97 98 99 // 2005100 addDateTestCase(UTC_1_JAN_2005);101 addDateTestCase(UTC_1_JAN_2005 - 1000);102 addDateTestCase(UTC_1_JAN_2005-TZ_ADJUST);103 104 105 106 70 //----------------------------------------------------------------------------------------------------- 107 71 test(); … … 112 76 { 113 77 testcases[tc++] = new TestCase( SECTION, status, expect, actual); 114 }115 116 117 function addDateTestCase(date_given_in_milliseconds)118 {119 var givenDate = new Date(date_given_in_milliseconds);120 121 status = 'Date.parse(' + givenDate + ').toLocaleString())';122 actual = Date.parse(givenDate.toLocaleString());123 expect = date_given_in_milliseconds;124 addTestCase();125 78 } 126 79
Note:
See TracChangeset
for help on using the changeset viewer.