aboutsummaryrefslogtreecommitdiffstats
path: root/test/suite/sputnik_converted/15_Native/15.6_Boolean_Objects/15.6.4_Properties_of_the_Boolean_Prototype_Object/S15.6.4.2_A1_T1.js
blob: 66272a43f4b4ceb68610124a06a29044f9b5a86a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/**
 * @name: S15.6.4.2_A1_T1;
 * @section: 15.6.4.2;
 * @assertion: toString: If this boolean value is true, then the string "true" 
 * is returned, otherwise, this boolean value must be false, and the string 
 * "false" is returned;
 * @description: no arguments;
 */


// Converted for Test262 from original Sputnik source

ES5Harness.registerTest( {
id: "S15.6.4.2_A1_T1",

path: "TestCases/15_Native/15.6_Boolean_Objects/15.6.4_Properties_of_the_Boolean_Prototype_Object/S15.6.4.2_A1_T1.js",

assertion: "toString: If this boolean value is true, then the string \"true\"",

description: "no arguments",

test: function testcase() {
   //CHECK#1
if(Boolean.prototype.toString() !== "false"){
  $ERROR('#1: Boolean.prototype.toString() === "false"');
}

//CHECK#2
if((new Boolean()).toString() !== "false"){
  $ERROR('#2: (new Boolean()).toString() === "false"');
}

//CHECK#3
if((new Boolean(false)).toString() !== "false"){
  $ERROR('#3: (new Boolean(false)).toString() === "false"');
}

//CHECK#4
if((new Boolean(true)).toString() !== "true"){
  $ERROR('#4: (new Boolean(true)).toString() === "true"');
}

//CHECK#5
if((new Boolean(1)).toString() !== "true"){
  $ERROR('#5: (new Boolean(1)).toString() === "true"');
}

//CHECK#6
if((new Boolean(0)).toString() !== "false"){
  $ERROR('#6: (new Boolean(0)).toString() === "false"');
}

//CHECK#7
if((new Boolean(new Object())).toString() !== "true"){
  $ERROR('#7: (new Boolean(new Object())).toString() === "true"');
}

 }
});