| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
gTestfile = '15.9.5.2-1.js'; |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
var SECTION = "15.9.5.2"; |
| 25 |
var VERSION = "ECMA_1"; |
| 26 |
startTest(); |
| 27 |
var TITLE = "Date.prototype.toString"; |
| 28 |
|
| 29 |
writeHeaderToLog( SECTION + " "+ TITLE); |
| 30 |
|
| 31 |
new TestCase( SECTION, |
| 32 |
"Date.prototype.toString.length", |
| 33 |
0, |
| 34 |
Date.prototype.toString.length ); |
| 35 |
|
| 36 |
var now = new Date(); |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
new TestCase( SECTION, |
| 42 |
"Math.abs(Date.parse(now.toString()) - now.valueOf()) < 1000", |
| 43 |
true, |
| 44 |
Math.abs(Date.parse(now.toString()) - now.valueOf()) < 1000 ); |
| 45 |
|
| 46 |
new TestCase( SECTION, |
| 47 |
"typeof now.toString()", |
| 48 |
"string", |
| 49 |
typeof now.toString() ); |
| 50 |
|
| 51 |
|
| 52 |
new TestCase( SECTION, |
| 53 |
"Date.parse( (new Date(0)).toString() )", |
| 54 |
0, |
| 55 |
Date.parse( (new Date(0)).toString() ) ); |
| 56 |
|
| 57 |
new TestCase( SECTION, |
| 58 |
"Date.parse( (new Date("+TZ_ADJUST+")).toString() )", |
| 59 |
TZ_ADJUST, |
| 60 |
Date.parse( (new Date(TZ_ADJUST)).toString() ) ); |
| 61 |
|
| 62 |
|
| 63 |
new TestCase( SECTION, |
| 64 |
"Date.parse( (new Date("+TIME_1900+")).toString() )", |
| 65 |
TIME_1900, |
| 66 |
Date.parse( (new Date(TIME_1900)).toString() ) ); |
| 67 |
|
| 68 |
new TestCase( SECTION, |
| 69 |
"Date.parse( (new Date("+TIME_1900 -TZ_ADJUST+")).toString() )", |
| 70 |
TIME_1900 -TZ_ADJUST, |
| 71 |
Date.parse( (new Date(TIME_1900 -TZ_ADJUST)).toString() ) ); |
| 72 |
|
| 73 |
|
| 74 |
new TestCase( SECTION, |
| 75 |
"Date.parse( (new Date("+TIME_2000+")).toString() )", |
| 76 |
TIME_2000, |
| 77 |
Date.parse( (new Date(TIME_2000)).toString() ) ); |
| 78 |
|
| 79 |
new TestCase( SECTION, |
| 80 |
"Date.parse( (new Date("+TIME_2000 -TZ_ADJUST+")).toString() )", |
| 81 |
TIME_2000 -TZ_ADJUST, |
| 82 |
Date.parse( (new Date(TIME_2000 -TZ_ADJUST)).toString() ) ); |
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
new TestCase( SECTION, |
| 87 |
"Date.parse( (new Date("+UTC_FEB_29_2000+")).toString() )", |
| 88 |
UTC_FEB_29_2000, |
| 89 |
Date.parse( (new Date(UTC_FEB_29_2000)).toString() ) ); |
| 90 |
|
| 91 |
new TestCase( SECTION, |
| 92 |
"Date.parse( (new Date("+(UTC_FEB_29_2000-1000)+")).toString() )", |
| 93 |
UTC_FEB_29_2000-1000, |
| 94 |
Date.parse( (new Date(UTC_FEB_29_2000-1000)).toString() ) ); |
| 95 |
|
| 96 |
|
| 97 |
new TestCase( SECTION, |
| 98 |
"Date.parse( (new Date("+(UTC_FEB_29_2000-TZ_ADJUST)+")).toString() )", |
| 99 |
UTC_FEB_29_2000-TZ_ADJUST, |
| 100 |
Date.parse( (new Date(UTC_FEB_29_2000-TZ_ADJUST)).toString() ) ); |
| 101 |
|
| 102 |
|
| 103 |
new TestCase( SECTION, |
| 104 |
"Date.parse( (new Date("+UTC_JAN_1_2005+")).toString() )", |
| 105 |
UTC_JAN_1_2005, |
| 106 |
Date.parse( (new Date(UTC_JAN_1_2005)).toString() ) ); |
| 107 |
|
| 108 |
new TestCase( SECTION, |
| 109 |
"Date.parse( (new Date("+(UTC_JAN_1_2005-1000)+")).toString() )", |
| 110 |
UTC_JAN_1_2005-1000, |
| 111 |
Date.parse( (new Date(UTC_JAN_1_2005-1000)).toString() ) ); |
| 112 |
|
| 113 |
new TestCase( SECTION, |
| 114 |
"Date.parse( (new Date("+(UTC_JAN_1_2005-TZ_ADJUST)+")).toString() )", |
| 115 |
UTC_JAN_1_2005-TZ_ADJUST, |
| 116 |
Date.parse( (new Date(UTC_JAN_1_2005-TZ_ADJUST)).toString() ) ); |
| 117 |
|
| 118 |
test(); |