js/src/tests/ecma_2/Statements/if-001.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/ecma_2/Statements/if-001.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,42 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +
    1.10 +/**
    1.11 + *  File Name:          if-001.js
    1.12 + *  ECMA Section:
    1.13 + *  Description:        The if statement
    1.14 + *
    1.15 + *  Verify that assignment in the if expression is evaluated correctly.
    1.16 + *  Verifies the fix for bug http://scopus/bugsplat/show_bug.cgi?id=148822.
    1.17 + *
    1.18 + *  Author:             christine@netscape.com
    1.19 + *  Date:               28 August 1998
    1.20 + */
    1.21 +var SECTION = "for-001";
    1.22 +var VERSION = "ECMA_2";
    1.23 +var TITLE   = "The if  statement";
    1.24 +var BUGNUMBER="148822";
    1.25 +
    1.26 +startTest();
    1.27 +writeHeaderToLog( SECTION + " "+ TITLE);
    1.28 +
    1.29 +var a = 0;
    1.30 +var b = 0;
    1.31 +var result = "passed";
    1.32 +
    1.33 +if ( a = b ) {
    1.34 +  result = "failed:  a = b should return 0";
    1.35 +}
    1.36 +
    1.37 +new TestCase(
    1.38 +  SECTION,
    1.39 +  "if ( a = b ), where a and b are both equal to 0",
    1.40 +  "passed",
    1.41 +  result );
    1.42 +
    1.43 +
    1.44 +test();
    1.45 +

mercurial