Debian Codegraph @

rhino/testsrc/tests/ecma/Date/15.9.2.2-4.js

raw symbols SCIP
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 gTestfile = '15.9.2.2-4.js';
7
8 /**
9 File Name: 15.9.2.2.js
10 ECMA Section: 15.9.2.2 Date constructor used as a function
11 Date( year, month, date, hours, minutes, seconds )
12 Description: The arguments are accepted, but are completely ignored.
13 A string is created and returned as if by the
14 expression (new Date()).toString().
15
16 Author: [email protected]
17 Date: 28 october 1997
18 Version: 9706
19
20 */
21 var VERSION = 9706;
22 startTest();
23 var SECTION = "15.9.2.2";
24 var TOLERANCE = 100;
25 var TITLE = "The Date Constructor Called as a Function";
26
27 writeHeaderToLog(SECTION+" "+TITLE );
28
29 // allow up to 1 second difference due to possibility
30 // the date may change by 1 second in between calls to Date
31
32 var d1;
33 var d2;
34
35 // Dates around feb 29, 2000
36
37 d1 = new Date();
38 d2 = Date.parse(Date(2000,1,29,0,0,0));
39 new TestCase(SECTION, "Date(2000,1,29,0,0,0)", true, d2 - d1 <= 1000);
40
41 d1 = new Date();
42 d2 = Date.parse(Date(2000,1,28,23,59,59));
43 new TestCase(SECTION, "Date(2000,1,28,23,59,59)", true, d2 - d1 <= 1000);
44
45 d1 = new Date();
46 d2 = Date.parse(Date(2000,1,27,16,0,0));
47 new TestCase(SECTION, "Date(2000,1,27,16,0,0)", true, d2 - d1 <= 1000);
48
49 test();