Debian Codegraph @

rhino/testsrc/tests/js1_3/Boolean/boolean-001.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 = 'boolean-001.js';
7
8 /**
9 * File Name: boolean-001.js
10 * Description:
11 *
12 * In JavaScript 1.2, new Boolean(false) evaluates to false.
13 *
14 * Author: [email protected]
15 * Date: 11 August 1998
16 */
17 var SECTION = "boolean-001.js";
18 var VERSION = "JS_1.3";
19 var TITLE = "new Boolean(false) should evaluate to false";
20
21 startTest();
22 writeHeaderToLog( SECTION + " "+ TITLE);
23
24 BooleanTest( "new Boolean(true)", new Boolean(true), true );
25 BooleanTest( "new Boolean(false)", new Boolean(false), true );
26 BooleanTest( "true", true, true );
27 BooleanTest( "false", false, false );
28
29 test();
30
31 function BooleanTest( string, object, expect ) {
32 if ( object ) {
33 result = true;
34 } else {
35 result = false;
36 }
37
38 new TestCase(
39 SECTION,
40 string,
41 expect,
42 result );
43 }
44