js/src/tests/js1_3/Boolean/boolean-001.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:ebb9cd1578b8
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
7 /**
8 * File Name: boolean-001.js
9 * Description:
10 *
11 * In JavaScript 1.2, new Boolean(false) evaluates to false.
12 *
13 * Author: christine@netscape.com
14 * Date: 11 August 1998
15 */
16 var SECTION = "boolean-001.js";
17 var VERSION = "JS_1.3";
18 var TITLE = "new Boolean(false) should evaluate to false";
19
20 startTest();
21 writeHeaderToLog( SECTION + " "+ TITLE);
22
23 BooleanTest( "new Boolean(true)", new Boolean(true), true );
24 BooleanTest( "new Boolean(false)", new Boolean(false), true );
25 BooleanTest( "true", true, true );
26 BooleanTest( "false", false, false );
27
28 test();
29
30 function BooleanTest( string, object, expect ) {
31 if ( object ) {
32 result = true;
33 } else {
34 result = false;
35 }
36
37 new TestCase(
38 SECTION,
39 string,
40 expect,
41 result );
42 }
43

mercurial