Changeset 10198 in webkit for trunk/JavaScriptCore/tests


Ignore:
Timestamp:
Aug 15, 2005, 1:37:10 PM (20 years ago)
Author:
darin
Message:

Reviewed by Darin.

  • tests/mozilla/ecma_3/Date/15.9.5.5.js: Remove the code which tests that Date.toLocaleString should be parsable by Date.parse. That is not true according to the spec.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/tests/mozilla/ecma_3/Date/15.9.5.5.js

    r5172 r10198  
    2828    portion of the Date in the current time zone in a convenient,
    2929    human-readable form.   We can't test the content of the string, 
    30     but can verify that the string is parsable by Date.parse
     30    but can verify that the object returned is a string.
    3131
    3232    The toLocaleString function is not generic; it generates a runtime error
     
    6868   addTestCase();
    6969
    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    // 1970
    79    addDateTestCase(0);
    80    addDateTestCase(TZ_ADJUST);   
    81 
    82    
    83    // 1900
    84    addDateTestCase(TIME_1900);
    85    addDateTestCase(TIME_1900 -TZ_ADJUST);
    86 
    87    
    88    // 2000
    89    addDateTestCase(TIME_2000);
    90    addDateTestCase(TIME_2000 -TZ_ADJUST);
    91 
    92    
    93    // 29 Feb 2000
    94    addDateTestCase(UTC_29_FEB_2000);
    95    addDateTestCase(UTC_29_FEB_2000 - 1000);   
    96    addDateTestCase(UTC_29_FEB_2000 - TZ_ADJUST);
    97  
    98 
    99    // 2005
    100    addDateTestCase(UTC_1_JAN_2005);
    101    addDateTestCase(UTC_1_JAN_2005 - 1000);
    102    addDateTestCase(UTC_1_JAN_2005-TZ_ADJUST);
    103    
    104 
    105 
    10670//-----------------------------------------------------------------------------------------------------
    10771   test();
     
    11276{
    11377  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();
    12578}
    12679
Note: See TracChangeset for help on using the changeset viewer.