js/src/tests/ecma/Date/15.9.4.2-1.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6
michael@0 7 /**
michael@0 8 * File Name:
michael@0 9 * Reference: http://bugzilla.mozilla.org/show_bug.cgi?id=4088
michael@0 10 * Description: Date parsing gets 12:30 AM wrong.
michael@0 11 * New behavior:
michael@0 12 * js> d = new Date('1/1/1999 13:30 AM')
michael@0 13 * Invalid Date
michael@0 14 * js> d = new Date('1/1/1999 13:30 PM')
michael@0 15 * Invalid Date
michael@0 16 * js> d = new Date('1/1/1999 12:30 AM')
michael@0 17 * Fri Jan 01 00:30:00 GMT-0800 (PST) 1999
michael@0 18 * js> d = new Date('1/1/1999 12:30 PM')
michael@0 19 * Fri Jan 01 12:30:00 GMT-0800 (PST) 1999
michael@0 20 * Author: christine@netscape.com
michael@0 21 */
michael@0 22
michael@0 23 var SECTION = "15.9.4.2-1"; // provide a document reference (ie, ECMA section)
michael@0 24 var VERSION = "ECMA"; // Version of JavaScript or ECMA
michael@0 25 var TITLE = "Regression Test for Date.parse"; // Provide ECMA section title or a description
michael@0 26 var BUGNUMBER = "http://bugzilla.mozilla.org/show_bug.cgi?id=4088"; // Provide URL to bugsplat or bugzilla report
michael@0 27
michael@0 28 startTest(); // leave this alone
michael@0 29
michael@0 30 AddTestCase( "new Date('1/1/1999 12:30 AM').toString()",
michael@0 31 new Date(1999,0,1,0,30).toString(),
michael@0 32 new Date('1/1/1999 12:30 AM').toString() );
michael@0 33
michael@0 34 AddTestCase( "new Date('1/1/1999 12:30 PM').toString()",
michael@0 35 new Date( 1999,0,1,12,30 ).toString(),
michael@0 36 new Date('1/1/1999 12:30 PM').toString() );
michael@0 37
michael@0 38 AddTestCase( "new Date('1/1/1999 13:30 AM')",
michael@0 39 "Invalid Date",
michael@0 40 new Date('1/1/1999 13:30 AM').toString() );
michael@0 41
michael@0 42
michael@0 43 AddTestCase( "new Date('1/1/1999 13:30 PM')",
michael@0 44 "Invalid Date",
michael@0 45 new Date('1/1/1999 13:30 PM').toString() );
michael@0 46
michael@0 47 test(); // leave this alone. this executes the test cases and
michael@0 48 // displays results.

mercurial