js/src/tests/ecma/String/15.5.4.2.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/ecma/String/15.5.4.2.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,53 @@
     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:          15.5.4.2.js
    1.12 +   ECMA Section:       15.5.4.2 String.prototype.toString
    1.13 +
    1.14 +   Description:
    1.15 +   Author:             christine@netscape.com
    1.16 +   Date:               28 october 1997
    1.17 +
    1.18 +*/
    1.19 +var SECTION = "15.5.4.2";
    1.20 +var VERSION = "ECMA_1";
    1.21 +startTest();
    1.22 +var TITLE   = "String.prototype.tostring";
    1.23 +
    1.24 +writeHeaderToLog( SECTION + " "+ TITLE);
    1.25 +
    1.26 +new TestCase(   SECTION,
    1.27 +		"String.prototype.toString() == String.prototype.valueOf()",
    1.28 +		true,
    1.29 +		String.prototype.toString() == String.prototype.valueOf() );
    1.30 +
    1.31 +new TestCase(   SECTION, "String.prototype.toString()",     "",     String.prototype.toString() );
    1.32 +new TestCase(   SECTION, "String.prototype.toString.length",    0,  String.prototype.toString.length );
    1.33 +
    1.34 +
    1.35 +new TestCase(   SECTION,
    1.36 +		"TESTSTRING = new String();TESTSTRING.valueOf() == TESTSTRING.toString()",
    1.37 +		true,
    1.38 +		eval("TESTSTRING = new String();TESTSTRING.valueOf() == TESTSTRING.toString()") );
    1.39 +new TestCase(   SECTION,
    1.40 +		"TESTSTRING = new String(true);TESTSTRING.valueOf() == TESTSTRING.toString()",
    1.41 +		true,
    1.42 +		eval("TESTSTRING = new String(true);TESTSTRING.valueOf() == TESTSTRING.toString()") );
    1.43 +new TestCase(   SECTION,
    1.44 +		"TESTSTRING = new String(false);TESTSTRING.valueOf() == TESTSTRING.toString()",
    1.45 +		true,
    1.46 +		eval("TESTSTRING = new String(false);TESTSTRING.valueOf() == TESTSTRING.toString()") );
    1.47 +new TestCase(   SECTION,
    1.48 +		"TESTSTRING = new String(Math.PI);TESTSTRING.valueOf() == TESTSTRING.toString()",
    1.49 +		true,
    1.50 +		eval("TESTSTRING = new String(Math.PI);TESTSTRING.valueOf() == TESTSTRING.toString()") );
    1.51 +new TestCase(   SECTION,
    1.52 +		"TESTSTRING = new String();TESTSTRING.valueOf() == TESTSTRING.toString()",
    1.53 +		true,
    1.54 +		eval("TESTSTRING = new String();TESTSTRING.valueOf() == TESTSTRING.toString()") );
    1.55 +
    1.56 +test();

mercurial