1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/js1_2/String/concat.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,50 @@ 1.4 +// |reftest| skip -- obsolete test 1.5 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 + 1.11 +/** 1.12 + Filename: concat.js 1.13 + Description: 'This tests the new String object method: concat' 1.14 + 1.15 + Author: NickLerissa 1.16 + Date: Fri Feb 13 09:58:28 PST 1998 1.17 +*/ 1.18 + 1.19 +var SECTION = 'As described in Netscape doc "Whats new in JavaScript 1.2"'; 1.20 +var VERSION = 'no version'; 1.21 +startTest(); 1.22 +var TITLE = 'String:concat'; 1.23 + 1.24 +writeHeaderToLog('Executing script: concat.js'); 1.25 +writeHeaderToLog( SECTION + " "+ TITLE); 1.26 + 1.27 +var aString = new String("test string"); 1.28 +var bString = new String(" another "); 1.29 + 1.30 +new TestCase( SECTION, "aString.concat(' more')", "test string more", aString.concat(' more').toString()); 1.31 +new TestCase( SECTION, "aString.concat(bString)", "test string another ", aString.concat(bString).toString()); 1.32 +new TestCase( SECTION, "aString ", "test string", aString.toString()); 1.33 +new TestCase( SECTION, "bString ", " another ", bString.toString()); 1.34 +new TestCase( SECTION, "aString.concat(345) ", "test string345", aString.concat(345).toString()); 1.35 +new TestCase( SECTION, "aString.concat(true) ", "test stringtrue", aString.concat(true).toString()); 1.36 +new TestCase( SECTION, "aString.concat(null) ", "test stringnull", aString.concat(null).toString()); 1.37 +new TestCase( SECTION, "aString.concat([]) ", "test string[]", aString.concat([]).toString()); 1.38 +new TestCase( SECTION, "aString.concat([1,2,3])", "test string[1, 2, 3]", aString.concat([1,2,3]).toString()); 1.39 + 1.40 +new TestCase( SECTION, "'abcde'.concat(' more')", "abcde more", 'abcde'.concat(' more').toString()); 1.41 +new TestCase( SECTION, "'abcde'.concat(bString)", "abcde another ", 'abcde'.concat(bString).toString()); 1.42 +new TestCase( SECTION, "'abcde' ", "abcde", 'abcde'); 1.43 +new TestCase( SECTION, "'abcde'.concat(345) ", "abcde345", 'abcde'.concat(345).toString()); 1.44 +new TestCase( SECTION, "'abcde'.concat(true) ", "abcdetrue", 'abcde'.concat(true).toString()); 1.45 +new TestCase( SECTION, "'abcde'.concat(null) ", "abcdenull", 'abcde'.concat(null).toString()); 1.46 +new TestCase( SECTION, "'abcde'.concat([]) ", "abcde[]", 'abcde'.concat([]).toString()); 1.47 +new TestCase( SECTION, "'abcde'.concat([1,2,3])", "abcde[1, 2, 3]", 'abcde'.concat([1,2,3]).toString()); 1.48 + 1.49 +//what should this do: 1.50 +new TestCase( SECTION, "'abcde'.concat() ", "abcde", 'abcde'.concat().toString()); 1.51 + 1.52 +test(); 1.53 +