1 /* The contents of this file are subject to the Netscape Public
2 * License Version 1.1 (the "License"); you may not use this file
3 * except in compliance with the License. You may obtain a copy of
4 * the License at http://www.mozilla.org/NPL/
6 * Software distributed under the License is distributed on an "AS
7 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
8 * implied. See the License for the specific language governing
9 * rights and limitations under the License.
11 * The Original Code is Mozilla Communicator client code, released March
14 * The Initial Developer of the Original Code is Netscape Communications
15 * Corporation. Portions created by Netscape are
16 * Copyright (C) 1998 Netscape Communications Corporation. All
27 http://scopus.mcom.com/bugsplat/show_bug.cgi?id=76103
29 Author: christine@netscape.com
30 Date: 12 november 1997
32 var SECTION = "new-001";
33 var VERSION = "JS1_3";
34 var TITLE = "new-001";
35 var BUGNUMBER="31567";
38 writeHeaderToLog( SECTION + " "+ TITLE);
40 var testcases = new Array();
42 function Test_One (x) {
47 function Test_Two( x, y ) {
52 testcases[tc++] = new TestCase(
58 testcases[tc++] = new TestCase(
62 new Test_One(18) +"" );
64 testcases[tc++] = new TestCase(
70 testcases[tc++] = new TestCase(
76 testcases[tc++] = new TestCase(
80 new Test_Two(2,7) +"" );
82 testcases[tc++] = new TestCase(
84 "new Test_Two(2,7).v",
86 new Test_Two(2,7).v );
88 testcases[tc++] = new TestCase(
90 "new (Function)(\"x\", \"return x+3\")(5,6)",
92 new (Function)("x","return x+3")(5,6) );
94 testcases[tc++] = new TestCase(
96 "new new Test_Two(String, 2).v(0123)",
98 new new Test_Two(String, 2).v(0123) +"");
100 testcases[tc++] = new TestCase(
102 "new new Test_Two(String, 2).v(0123).length",
104 new new Test_Two(String, 2).v(0123).length );
109 for ( tc=0; tc < testcases.length; tc++ ) {
110 testcases[tc].passed = writeTestCaseResult(
111 testcases[tc].expect,
112 testcases[tc].actual,
113 testcases[tc].description +" = "+
114 testcases[tc].actual );
116 testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
119 return ( testcases );