diff options
Diffstat (limited to 'external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator')
23 files changed, 799 insertions, 0 deletions
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A1.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A1.js new file mode 100644 index 000000000..39a2df261 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A1.js @@ -0,0 +1,60 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.10.1_A1; +* @section: 11.10.1; +* @assertion: White Space and Line Terminator between BitwiseANDExpression and "&" or between "&" and EqualityExpression are allowed; +* @description: Checking uses eval; +*/ + +//CHECK#1 +if ((eval("1\u0009&\u00091")) !== 1) { + $ERROR('#1: (1\\u0009&\\u00091) === 1'); +} + +//CHECK#2 +if ((eval("1\u000B&\u000B1")) !== 1) { + $ERROR('#2: (1\\u000B&\\u000B1) === 1'); +} + +//CHECK#3 +if ((eval("1\u000C&\u000C1")) !== 1) { + $ERROR('#3: (1\\u000C&\\u000C1) === 1'); +} + +//CHECK#4 +if ((eval("1\u0020&\u00201")) !== 1) { + $ERROR('#4: (1\\u0020&\\u00201) === 1'); +} + +//CHECK#5 +if ((eval("1\u00A0&\u00A01")) !== 1) { + $ERROR('#5: (1\\u00A0&\\u00A01) === 1'); +} + +//CHECK#6 +if ((eval("1\u000A&\u000A1")) !== 1) { + $ERROR('#6: (1\\u000A&\\u000A1) === 1'); +} + +//CHECK#7 +if ((eval("1\u000D&\u000D1")) !== 1) { + $ERROR('#7: (1\\u000D&\\u000D1) === 1'); +} + +//CHECK#8 +if ((eval("1\u2028&\u20281")) !== 1) { + $ERROR('#8: (1\\u2028&\\u20281) === 1'); +} + +//CHECK#9 +if ((eval("1\u2029&\u20291")) !== 1) { + $ERROR('#9: (1\\u2029&\\u20291) === 1'); +} + + +//CHECK#10 +if ((eval("1\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u2029&\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u20291")) !== 1) { + $ERROR('#10: (1\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029&\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20291) === 1'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A2.1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A2.1_T1.js new file mode 100644 index 000000000..0cb8479a8 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A2.1_T1.js @@ -0,0 +1,42 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S11.10.1_A2.1_T1; + * @section: 11.10.1; + * @assertion: Operator x & y uses GetValue; + * @description: Either Type is not Reference or GetBase is not null; +*/ + +//CHECK#1 +if ((1 & 1) !== 1) { + $ERROR('#1: (1 & 1) === 1. Actual: ' + ((1 & 1))); +} + +//CHECK#2 +var x = 1; +if ((x & 1) !== 1) { + $ERROR('#2: var x = 1; (x & 1) === 1. Actual: ' + ((x & 1))); +} + +//CHECK#3 +var y = 1; +if ((1 & y) !== 1) { + $ERROR('#3: var y = 1; (1 & y) === 1. Actual: ' + ((1 & y))); +} + +//CHECK#4 +var x = 1; +var y = 1; +if ((x & y) !== 1) { + $ERROR('#4: var x = 1; var y = 1; (x & y) === 1. Actual: ' + ((x & y))); +} + +//CHECK#5 +var objectx = new Object(); +var objecty = new Object(); +objectx.prop = 1; +objecty.prop = 1; +if ((objectx.prop & objecty.prop) !== 1) { + $ERROR('#5: var objectx = new Object(); var objecty = new Object(); objectx.prop = 1; objecty.prop = 1; (objectx.prop & objecty.prop) === 1. Actual: ' + ((objectx.prop & objecty.prop))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A2.1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A2.1_T2.js new file mode 100644 index 000000000..6863c2c8a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A2.1_T2.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S11.10.1_A2.1_T2; + * @section: 11.10.1; + * @assertion: Operator x & y uses GetValue; + * @description: If GetBase(x) is null, throw ReferenceError; +*/ + +//CHECK#1 +try { + x & 1; + $ERROR('#1.1: x & 1 throw ReferenceError. Actual: ' + (x & 1)); +} +catch (e) { + if ((e instanceof ReferenceError) !== true) { + $ERROR('#1.2: x & 1 throw ReferenceError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A2.1_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A2.1_T3.js new file mode 100644 index 000000000..fb06c6dc2 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A2.1_T3.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S11.10.1_A2.1_T3; + * @section: 11.10.1; + * @assertion: Operator x & y uses GetValue; + * @description: If GetBase(y) is null, throw ReferenceError; +*/ + +//CHECK#1 +try { + 1 & y; + $ERROR('#1.1: 1 & y throw ReferenceError. Actual: ' + (1 & y)); +} +catch (e) { + if ((e instanceof ReferenceError) !== true) { + $ERROR('#1.2: 1 & y throw ReferenceError. Actual: ' + (e)); + } +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A2.2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A2.2_T1.js new file mode 100644 index 000000000..5f1e0ab00 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A2.2_T1.js @@ -0,0 +1,70 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S11.10.1_A2.2_T1; + * @section: 11.10.1, 8.6.2.6; + * @assertion: Operator x & y uses [[Default Value]]; + * @description: If Type(value) is Object, evaluate ToPrimitive(value, Number); + */ + +//CHECK#1 +if (({valueOf: function() {return 1}} & 1) !== 1) { + $ERROR('#1: ({valueOf: function() {return 1}} & 1) === 1. Actual: ' + (({valueOf: function() {return 1}} & 1))); +} + +//CHECK#2 +if (({valueOf: function() {return 1}, toString: function() {return 0}} & 1) !== 1) { + $ERROR('#2: ({valueOf: function() {return 1}, toString: function() {return 0}} & 1) === 1. Actual: ' + (({valueOf: function() {return 1}, toString: function() {return 0}} & 1))); +} + +//CHECK#3 +if (({valueOf: function() {return 1}, toString: function() {return {}}} & 1) !== 1) { + $ERROR('#3: ({valueOf: function() {return 1}, toString: function() {return {}}} & 1) === 1. Actual: ' + (({valueOf: function() {return 1}, toString: function() {return {}}} & 1))); +} + +//CHECK#4 +try { + if (({valueOf: function() {return 1}, toString: function() {throw "error"}} & 1) !== 1) { + $ERROR('#4.1: ({valueOf: function() {return 1}, toString: function() {throw "error"}} & 1) === 1. Actual: ' + (({valueOf: function() {return 1}, toString: function() {throw "error"}} & 1))); + } +} +catch (e) { + if (e === "error") { + $ERROR('#4.2: ({valueOf: function() {return 1}, toString: function() {throw "error"}} & 1) not throw "error"'); + } else { + $ERROR('#4.3: ({valueOf: function() {return 1}, toString: function() {throw "error"}} & 1) not throw Error. Actual: ' + (e)); + } +} + +//CHECK#5 +if ((1 & {toString: function() {return 1}}) !== 1) { + $ERROR('#5.1: (1 & {toString: function() {return 1}}) === 1. Actual: ' + ((1 & {toString: function() {return 1}}))); +} + +//CHECK#6 +if ((1 & {valueOf: function() {return {}}, toString: function() {return 1}}) !== 1) { + $ERROR('#6: (1 & {valueOf: function() {return {}}, toString: function() {return 1}}) === 1. Actual: ' + ((1 & {valueOf: function() {return {}}, toString: function() {return 1}}))); +} + +//CHECK#7 +try { + 1 & {valueOf: function() {throw "error"}, toString: function() {return 1}}; + $ERROR('#7.1: 1 & {valueOf: function() {throw "error"}, toString: function() {return 1}} throw "error". Actual: ' + (1 & {valueOf: function() {throw "error"}, toString: function() {return 1}})); +} +catch (e) { + if (e !== "error") { + $ERROR('#7.2: 1 & {valueOf: function() {throw "error"}, toString: function() {return 1}} throw "error". Actual: ' + (e)); + } +} + +//CHECK#8 +try { + 1 & {valueOf: function() {return {}}, toString: function() {return {}}}; + $ERROR('#8.1: 1 & {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (1 & {valueOf: function() {return {}}, toString: function() {return {}}})); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#8.2: 1 & {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A2.3_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A2.3_T1.js new file mode 100644 index 000000000..5d226b3a8 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A2.3_T1.js @@ -0,0 +1,25 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S11.10.1_A2.3_T1; + * @section: 11.10.1; + * @assertion: ToInt32(first expression) is called first, and then ToInt32(second expression); + * @description: Checking by using "throw"; +*/ + +//CHECK#1 +var x = { valueOf: function () { throw "x"; } }; +var y = { valueOf: function () { throw "y"; } }; +try { + x & y; + $ERROR('#1.1: var x = { valueOf: function () { throw "x"; } }; var y = { valueOf: function () { throw "y"; } }; x & y throw "x". Actual: ' + (x & y)); +} catch (e) { + if (e === "y") { + $ERROR('#1.2: ToInt32(first expression) is called first, and then ToInt32(second expression)'); + } else { + if (e !== "x") { + $ERROR('#1.3: var x = { valueOf: function () { throw "x"; } }; var y = { valueOf: function () { throw "y"; } }; x & y throw "x". Actual: ' + (e)); + } + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A2.4_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A2.4_T1.js new file mode 100644 index 000000000..73bc10536 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A2.4_T1.js @@ -0,0 +1,22 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S11.10.1_A2.4_T1; + * @section: 11.10.1; + * @assertion: First expression is evaluated first, and then second expression; + * @description: Checking with "="; +*/ + +//CHECK#1 +var x = 0; +if (((x = 1) & x) !== 1) { + $ERROR('#1: var x = 0; ((x = 1) & x) === 1. Actual: ' + (((x = 1) & x))); +} + +//CHECK#2 +var x = 0; +if ((x & (x = 1)) !== 0) { + $ERROR('#2: var x = 0; (x & (x = 1)) === 0. Actual: ' + ((x & (x = 1)))); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A2.4_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A2.4_T2.js new file mode 100644 index 000000000..44ad93487 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A2.4_T2.js @@ -0,0 +1,25 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S11.10.1_A2.4_T2; + * @section: 11.10.1; + * @assertion: First expression is evaluated first, and then second expression; + * @description: Checking with "throw"; +*/ + +//CHECK#1 +var x = function () { throw "x"; }; +var y = function () { throw "y"; }; +try { + x() & y(); + $ERROR('#1.1: var x = function () { throw "x"; }; var y = function () { throw "y"; }; x() & y() throw "x". Actual: ' + (x() & y())); +} catch (e) { + if (e === "y") { + $ERROR('#1.2: First expression is evaluated first, and then second expression'); + } else { + if (e !== "x") { + $ERROR('#1.3: var x = function () { throw "x"; }; var y = function () { throw "y"; }; x() & y() throw "x". Actual: ' + (e)); + } + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A2.4_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A2.4_T3.js new file mode 100644 index 000000000..4abf60cc6 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A2.4_T3.js @@ -0,0 +1,26 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S11.10.1_A2.4_T3; + * @section: 11.10.1; + * @assertion: First expression is evaluated first, and then second expression; + * @description: Checking with undeclarated variables; +*/ + +//CHECK#1 +try { + x & (x = 1); + $ERROR('#1.1: x & (x = 1) throw ReferenceError. Actual: ' + (x & (x = 1))); +} +catch (e) { + if ((e instanceof ReferenceError) !== true) { + $ERROR('#1.2: x & (x = 1) throw ReferenceError. Actual: ' + (e)); + } +} + +//CHECK#2 +if (((y = 1) & y) !== 1) { + $ERROR('#2: ((y = 1) & y) === 1. Actual: ' + (((y = 1) & y))); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T1.1.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T1.1.js new file mode 100644 index 000000000..1153fa443 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T1.1.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S11.10.1_A3_T1.1; + * @section: 11.10.1; + * @assertion: Operator x & y returns ToNumber(x) & ToNumber(y); + * @description: Type(x) and Type(y) are primitive boolean and Boolean object; + */ + +//CHECK#1 +if ((true & true) !== 1) { + $ERROR('#1: (true & true) === 1. Actual: ' + ((true & true))); +} + +//CHECK#2 +if ((new Boolean(true) & true) !== 1) { + $ERROR('#2: (new Boolean(true) & true) === 1. Actual: ' + ((new Boolean(true) & true))); +} + +//CHECK#3 +if ((true & new Boolean(true)) !== 1) { + $ERROR('#3: (true & new Boolean(true)) === 1. Actual: ' + ((true & new Boolean(true)))); +} + +//CHECK#4 +if ((new Boolean(true) & new Boolean(true)) !== 1) { + $ERROR('#4: (new Boolean(true) & new Boolean(true)) === 1. Actual: ' + ((new Boolean(true) & new Boolean(true)))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T1.2.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T1.2.js new file mode 100644 index 000000000..38d434616 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T1.2.js @@ -0,0 +1,30 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S11.10.1_A3_T1.2; + * @section: 11.10.1; + * @assertion: Operator x & y returns ToNumber(x) & ToNumber(y); + * @description: Type(x) and Type(y) are primitive number and Number object; +*/ + +//CHECK#1 +if ((1 & 1) !== 1) { + $ERROR('#1: (1 & 1) === 1. Actual: ' + ((1 & 1))); +} + +//CHECK#2 +if ((new Number(1) & 1) !== 1) { + $ERROR('#2: (new Number(1) & 1) === 1. Actual: ' + ((new Number(1) & 1))); +} + +//CHECK#3 +if ((1 & new Number(1)) !== 1) { + $ERROR('#3: (1 & new Number(1)) === 1. Actual: ' + ((1 & new Number(1)))); +} + +//CHECK#4 +if ((new Number(1) & new Number(1)) !== 1) { + $ERROR('#4: (new Number(1) & new Number(1)) === 1. Actual: ' + ((new Number(1) & new Number(1)))); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T1.3.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T1.3.js new file mode 100644 index 000000000..67865a4c0 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T1.3.js @@ -0,0 +1,39 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S11.10.1_A3_T1.3; + * @section: 11.10.1; + * @assertion: Operator x & y returns ToNumber(x) & ToNumber(y); + * @description: Type(x) and Type(y) are primitive string and String object; +*/ + +//CHECK#1 +if (("1" & "1") !== 1) { + $ERROR('#1: ("1" & "1") === 1. Actual: ' + (("1" & "1"))); +} + +//CHECK#2 +if ((new String("1") & "1") !== 1) { + $ERROR('#2: (new String("1") & "1") === 1. Actual: ' + ((new String("1") & "1"))); +} + +//CHECK#3 +if (("1" & new String("1")) !== 1) { + $ERROR('#3: ("1" & new String("1")) === 1. Actual: ' + (("1" & new String("1")))); +} + +//CHECK#4 +if ((new String("1") & new String("1")) !== 1) { + $ERROR('#4: (new String("1") & new String("1")) === 1. Actual: ' + ((new String("1") & new String("1")))); +} + +//CHECK#5 +if (("x" & "1") !== 0) { + $ERROR('#5: ("x" & "1") === 0. Actual: ' + (("x" & "1"))); +} + +//CHECK#6 +if (("1" & "x") !== 0) { + $ERROR('#6: ("1" & "x") === 0. Actual: ' + (("1" & "x"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T1.4.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T1.4.js new file mode 100644 index 000000000..0b8ba8776 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T1.4.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S11.10.1_A3_T1.4; + * @section: 11.10.1; + * @assertion: Operator x & y returns ToNumber(x) & ToNumber(y); + * @description: Type(x) and Type(y) are null and undefined; +*/ + +//CHECK#1 +if ((null & undefined) !== 0) { + $ERROR('#1: (null & undefined) === 0. Actual: ' + ((null & undefined))); +} + +//CHECK#2 +if ((undefined & null) !== 0) { + $ERROR('#2: (undefined & null) === 0. Actual: ' + ((undefined & null))); +} + +//CHECK#3 +if ((undefined & undefined) !== 0) { + $ERROR('#3: (undefined & undefined) === 0. Actual: ' + ((undefined & undefined))); +} + +//CHECK#4 +if ((null & null) !== 0) { + $ERROR('#4: (null & null) === 0. Actual: ' + ((null & null))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T1.5.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T1.5.js new file mode 100644 index 000000000..43820e22d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T1.5.js @@ -0,0 +1,30 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S11.10.1_A3_T1.5; + * @section: 11.10.1; + * @assertion: Operator x & y returns ToNumber(x) & ToNumber(y); + * @description: Type(x) and Type(y) are Object object and Function object; + */ + +//CHECK#1 +if (({} & function(){return 1}) !== 0) { + $ERROR('#1: ({} & function(){return 1}) === 0. Actual: ' + (({} & function(){return 1}))); +} + +//CHECK#2 +if ((function(){return 1} & {}) !== 0) { + $ERROR('#2: (function(){return 1} & {}) === 0. Actual: ' + ((function(){return 1} & {}))); +} + +//CHECK#3 +if ((function(){return 1} & function(){return 1}) !== 0) { + $ERROR('#3: (function(){return 1} & function(){return 1}) === 0. Actual: ' + ((function(){return 1} & function(){return 1}))); +} + +//CHECK#4 +if (({} & {}) !== 0) { + $ERROR('#4: ({} & {}) === 0. Actual: ' + (({} & {}))); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T2.1.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T2.1.js new file mode 100644 index 000000000..2955d2bdf --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T2.1.js @@ -0,0 +1,49 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S11.10.1_A3_T2.1; + * @section: 11.10.1; + * @assertion: Operator x & y returns ToNumber(x) & ToNumber(y); + * @description: Type(x) is different from Type(y) and both types vary between Number (primitive or object) and Boolean (primitive and object); + */ + +//CHECK#1 +if ((true & 1) !== 1) { + $ERROR('#1: (true & 1) === 1. Actual: ' + ((true & 1))); +} + +//CHECK#2 +if ((1 & true) !== 1) { + $ERROR('#2: (1 & true) === 1. Actual: ' + ((1 & true))); +} + +//CHECK#3 +if ((new Boolean(true) & 1) !== 1) { + $ERROR('#3: (new Boolean(true) & 1) === 1. Actual: ' + ((new Boolean(true) & 1))); +} + +//CHECK#4 +if ((1 & new Boolean(true)) !== 1) { + $ERROR('#4: (1 & new Boolean(true)) === 1. Actual: ' + ((1 & new Boolean(true)))); +} + +//CHECK#5 +if ((true & new Number(1)) !== 1) { + $ERROR('#5: (true & new Number(1)) === 1. Actual: ' + ((true & new Number(1)))); +} + +//CHECK#6 +if ((new Number(1) & true) !== 1) { + $ERROR('#6: (new Number(1) & true) === 1. Actual: ' + ((new Number(1) & true))); +} + +//CHECK#7 +if ((new Boolean(true) & new Number(1)) !== 1) { + $ERROR('#7: (new Boolean(true) & new Number(1)) === 1. Actual: ' + ((new Boolean(true) & new Number(1)))); +} + +//CHECK#8 +if ((new Number(1) & new Boolean(true)) !== 1) { + $ERROR('#8: (new Number(1) & new Boolean(true)) === 1. Actual: ' + ((new Number(1) & new Boolean(true)))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T2.2.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T2.2.js new file mode 100644 index 000000000..92f7dc058 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T2.2.js @@ -0,0 +1,59 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S11.10.1_A3_T2.2; + * @section: 11.10.1; + * @assertion: Operator x & y returns ToNumber(x) & ToNumber(y); + * @description: Type(x) is different from Type(y) and both types vary between Number (primitive or object) and String (primitive and object); +*/ + +//CHECK#1 +if (("1" & 1) !== 1) { + $ERROR('#1: ("1" & 1) === 1. Actual: ' + (("1" & 1))); +} + +//CHECK#2 +if ((1 & "1") !== 1) { + $ERROR('#2: (1 & "1") === 1. Actual: ' + ((1 & "1"))); +} + +//CHECK#3 +if ((new String("1") & 1) !== 1) { + $ERROR('#3: (new String("1") & 1) === 1. Actual: ' + ((new String("1") & 1))); +} + +//CHECK#4 +if ((1 & new String("1")) !== 1) { + $ERROR('#4: (1 & new String("1")) === 1. Actual: ' + ((1 & new String("1")))); +} + +//CHECK#5 +if (("1" & new Number(1)) !== 1) { + $ERROR('#5: ("1" & new Number(1)) === 1. Actual: ' + (("1" & new Number(1)))); +} + +//CHECK#6 +if ((new Number(1) & "1") !== 1) { + $ERROR('#6: (new Number(1) & "1") === 1. Actual: ' + ((new Number(1) & "1"))); +} + +//CHECK#7 +if ((new String("1") & new Number(1)) !== 1) { + $ERROR('#7: (new String("1") & new Number(1)) === 1. Actual: ' + ((new String("1") & new Number(1)))); +} + +//CHECK#8 +if ((new Number(1) & new String("1")) !== 1) { + $ERROR('#8: (new Number(1) & new String("1")) === 1. Actual: ' + ((new Number(1) & new String("1")))); +} + +//CHECK#9 +if (("x" & 1) !== 0) { + $ERROR('#9: ("x" & 1) === 0. Actual: ' + (("x" & 1))); +} + +//CHECK#10 +if ((1 & "x") !== 0) { + $ERROR('#10: (1 & "x") === 0. Actual: ' + ((1 & "x"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T2.3.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T2.3.js new file mode 100644 index 000000000..2e7acb90d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T2.3.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S11.10.1_A3_T2.3; + * @section: 11.10.1; + * @assertion: Operator x & y returns ToNumber(x) & ToNumber(y); + * @description: Type(x) is different from Type(y) and both types vary between Number (primitive or object) and Null; + */ + +//CHECK#1 +if ((1 & null) !== 0) { + $ERROR('#1: (1 & null) === 0. Actual: ' + ((1 & null))); +} + +//CHECK#2 +if ((null & 1) !== 0) { + $ERROR('#2: (null & 1) === 0. Actual: ' + ((null & 1))); +} + +//CHECK#3 +if ((new Number(1) & null) !== 0) { + $ERROR('#3: (new Number(1) & null) === 0. Actual: ' + ((new Number(1) & null))); +} + +//CHECK#4 +if ((null & new Number(1)) !== 0) { + $ERROR('#4: (null & new Number(1)) === 0. Actual: ' + ((null & new Number(1)))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T2.4.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T2.4.js new file mode 100644 index 000000000..bf7529670 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T2.4.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S11.10.1_A3_T2.4; + * @section: 11.10.1; + * @assertion: Operator x & y returns ToNumber(x) & ToNumber(y); + * @description: Type(x) is different from Type(y) and both types vary between Number (primitive or object) and Undefined; + */ + +//CHECK#1 +if ((1 & undefined) !== 0) { + $ERROR('#1: (1 & undefined) === 0. Actual: ' + ((1 & undefined))); +} + +//CHECK#2 +if ((undefined & 1) !== 0) { + $ERROR('#2: (undefined & 1) === 0. Actual: ' + ((undefined & 1))); +} + +//CHECK#3 +if ((new Number(1) & undefined) !== 0) { + $ERROR('#3: (new Number(1) & undefined) === 0. Actual: ' + ((new Number(1) & undefined))); +} + +//CHECK#4 +if ((undefined & new Number(1)) !== 0) { + $ERROR('#4: (undefined & new Number(1)) === 0. Actual: ' + ((undefined & new Number(1)))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T2.5.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T2.5.js new file mode 100644 index 000000000..6ec95b067 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T2.5.js @@ -0,0 +1,49 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S11.10.1_A3_T2.5; + * @section: 11.10.1; + * @assertion: Operator x & y returns ToNumber(x) & ToNumber(y); + * @description: Type(x) us different from Type(y) and both types are String (primitive or object) or Boolean (primitive and object); +*/ + +//CHECK#1 +if ((true & "1") !== 1) { + $ERROR('#1: (true & "1") === 1. Actual: ' + ((true & "1"))); +} + +//CHECK#2 +if (("1" & true) !== 1) { + $ERROR('#2: ("1" & true) === 1. Actual: ' + (("1" & true))); +} + +//CHECK#3 +if ((new Boolean(true) & "1") !== 1) { + $ERROR('#3: (new Boolean(true) & "1") === 1. Actual: ' + ((new Boolean(true) & "1"))); +} + +//CHECK#4 +if (("1" & new Boolean(true)) !== 1) { + $ERROR('#4: ("1" & new Boolean(true)) === 1. Actual: ' + (("1" & new Boolean(true)))); +} + +//CHECK#5 +if ((true & new String("1")) !== 1) { + $ERROR('#5: (true & new String("1")) === 1. Actual: ' + ((true & new String("1")))); +} + +//CHECK#6 +if ((new String("1") & true) !== 1) { + $ERROR('#6: (new String("1") & true) === 1. Actual: ' + ((new String("1") & true))); +} + +//CHECK#7 +if ((new Boolean(true) & new String("1")) !== 1) { + $ERROR('#7: (new Boolean(true) & new String("1")) === 1. Actual: ' + ((new Boolean(true) & new String("1")))); +} + +//CHECK#8 +if ((new String("1") & new Boolean(true)) !== 1) { + $ERROR('#8: (new String("1") & new Boolean(true)) === 1. Actual: ' + ((new String("1") & new Boolean(true)))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T2.6.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T2.6.js new file mode 100644 index 000000000..a9d0ac863 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T2.6.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S11.10.1_A3_T2.6; + * @section: 11.10.1; + * @assertion: Operator x & y returns ToNumber(x) & ToNumber(y); + * @description: Type(x) is different from Type(y) and both types vary between String (primitive or object) and Undefined; + */ + +//CHECK#1 +if (("1" & undefined) !== 0) { + $ERROR('#1: ("1" & undefined) === 0. Actual: ' + (("1" & undefined))); +} + +//CHECK#2 +if ((undefined & "1") !== 0) { + $ERROR('#2: (undefined & "1") === 0. Actual: ' + ((undefined & "1"))); +} + +//CHECK#3 +if ((new String("1") & undefined) !== 0) { + $ERROR('#3: (new String("1") & undefined) === 0. Actual: ' + ((new String("1") & undefined))); +} + +//CHECK#4 +if ((undefined & new String("1")) !== 0) { + $ERROR('#4: (undefined & new String("1")) === 0. Actual: ' + ((undefined & new String("1")))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T2.7.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T2.7.js new file mode 100644 index 000000000..83c8fc5fd --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T2.7.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S11.10.1_A3_T2.7; + * @section: 11.10.1; + * @assertion: Operator x & y returns ToNumber(x) & ToNumber(y); + * @description: Type(x) is different from Type(y) and both types vary between String (primitive or object) and Null; + */ + +//CHECK#1 +if (("1" & null) !== 0) { + $ERROR('#1: ("1" & null) === 0. Actual: ' + (("1" & null))); +} + +//CHECK#2 +if ((null & "1") !== 0) { + $ERROR('#2: (null & "1") === 0. Actual: ' + ((null & "1"))); +} + +//CHECK#3 +if ((new String("1") & null) !== 0) { + $ERROR('#3: (new String("1") & null) === 0. Actual: ' + ((new String("1") & null))); +} + +//CHECK#4 +if ((null & new String("1")) !== 0) { + $ERROR('#4: (null & new String("1")) === 0. Actual: ' + ((null & new String("1")))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T2.8.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T2.8.js new file mode 100644 index 000000000..24b70fff8 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T2.8.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S11.10.1_A3_T2.8; + * @section: 11.10.1; + * @assertion: Operator x & y returns ToNumber(x) & ToNumber(y); + * @description: Type(x) is different from Type(y) and both types vary between Boolean (primitive or object) and Undefined; + */ + +//CHECK#1 +if ((true & undefined) !== 0) { + $ERROR('#1: (true & undefined) === 0. Actual: ' + ((true & undefined))); +} + +//CHECK#2 +if ((undefined & true) !== 0) { + $ERROR('#2: (undefined & true) === 0. Actual: ' + ((undefined & true))); +} + +//CHECK#3 +if ((new Boolean(true) & undefined) !== 0) { + $ERROR('#3: (new Boolean(true) & undefined) === 0. Actual: ' + ((new Boolean(true) & undefined))); +} + +//CHECK#4 +if ((undefined & new Boolean(true)) !== 0) { + $ERROR('#4: (undefined & new Boolean(true)) === 0. Actual: ' + ((undefined & new Boolean(true)))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T2.9.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T2.9.js new file mode 100644 index 000000000..d90a0d253 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.10_Binary_Bitwise_Operators/11.10.1_AND_Operator/S11.10.1_A3_T2.9.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S11.10.1_A3_T2.9; + * @section: 11.10.1; + * @assertion: Operator x & y returns ToNumber(x) & ToNumber(y); + * @description: Type(x) is different from Type(y) and both types vary between Boolean (primitive or object) and Null; + */ + +//CHECK#1 +if ((true & null) !== 0) { + $ERROR('#1: (true & null) === 0. Actual: ' + ((true & null))); +} + +//CHECK#2 +if ((null & true) !== 0) { + $ERROR('#2: (null & true) === 0. Actual: ' + ((null & true))); +} + +//CHECK#3 +if ((new Boolean(true) & null) !== 0) { + $ERROR('#3: (new Boolean(true) & null) === 0. Actual: ' + ((new Boolean(true) & null))); +} + +//CHECK#4 +if ((null & new Boolean(true)) !== 0) { + $ERROR('#4: (null & new Boolean(true)) === 0. Actual: ' + ((null & new Boolean(true)))); +} |