diff options
Diffstat (limited to 'external/contributions/Google/sputniktests/tests/Conformance/08_Types/8.1_The_Undefined_Type')
7 files changed, 149 insertions, 0 deletions
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/08_Types/8.1_The_Undefined_Type/S8.1_A1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/08_Types/8.1_The_Undefined_Type/S8.1_A1_T1.js new file mode 100644 index 000000000..09cf97266 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/08_Types/8.1_The_Undefined_Type/S8.1_A1_T1.js @@ -0,0 +1,12 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S8.1_A1_T1; + * @section: 8.1; + * @assertion: The Undefined type has one value, called undefined; + * @description: Checking if execution of "var x = undefined" passes; +*/ + +// CHECK#1 +var x = undefined; diff --git a/external/contributions/Google/sputniktests/tests/Conformance/08_Types/8.1_The_Undefined_Type/S8.1_A1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/08_Types/8.1_The_Undefined_Type/S8.1_A1_T2.js new file mode 100644 index 000000000..b3c2e0859 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/08_Types/8.1_The_Undefined_Type/S8.1_A1_T2.js @@ -0,0 +1,24 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S8.1_A1_T2; + * @section: 8.1; + * @assertion: The Undefined type has one value, called undefined; + * @description: Check typeof(undefined) and typeof(void 0); +*/ + +// CHECK#1 +if (!(typeof(undefined) === "undefined")) { + ERROR('#1: typeof(undefined) === "undefined". Actual: ' + (typeof(undefined))); +} + +// CHECK#2 +if (!(typeof(void 0) === "undefined")) { + ERROR('#2: typeof(void 0) === "undefined". Actual: ' + (typeof(void 0))); +} + +// CHECK#3 +if (!(undefined === void 0)) { + ERROR('#3: undefined === void 0'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/08_Types/8.1_The_Undefined_Type/S8.1_A2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/08_Types/8.1_The_Undefined_Type/S8.1_A2_T1.js new file mode 100644 index 000000000..0a99c4117 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/08_Types/8.1_The_Undefined_Type/S8.1_A2_T1.js @@ -0,0 +1,35 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S8.1_A2_T1; + * @section: 8.1; + * @assertion: Any variable that has not been assigned a value has the value undefined; + * @description: Check that var x have value and type undefined; +*/ + +var x; + +/////////////////////////////////////////////////////////////////// +// CHECK#1 +if (!(x === undefined)) { + $ERROR('#1: var x; x === undefined. Actual: ' + (x)); +} +// +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// CHECK#2 +if (!(typeof(x) === "undefined")) { + $ERROR('#2: var x; typeof(x) === "undefined". Actual: ' + (typeof(x))); +} +// +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// CHECK#3 +if (!(x === void 0)) { + $ERROR('#3: var x; x === void 0. Actual: ' + (x)); +} +// +/////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/08_Types/8.1_The_Undefined_Type/S8.1_A2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/08_Types/8.1_The_Undefined_Type/S8.1_A2_T2.js new file mode 100644 index 000000000..ee8d56ad0 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/08_Types/8.1_The_Undefined_Type/S8.1_A2_T2.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: S8.1_A2_T2; + * @section: 8.1; + * @assertion: Any variable that has not been assigned a value has the value undefined; + * @description: Function return undefined; +*/ + +// CHECK#1 +function test1(x) { + return x; +} + +if (!(test1() === void 0)) { + $ERROR('#1: function test1(x){return x} test1() === void 0. Actual: ' + (test1())); +} + +// CHECK#2 +function test2() { +} + +if (!(test2() === void 0)) { + $ERROR('#2: function test2(){} test2() === void 0. Actual: ' + (test2())); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/08_Types/8.1_The_Undefined_Type/S8.1_A3.js b/external/contributions/Google/sputniktests/tests/Conformance/08_Types/8.1_The_Undefined_Type/S8.1_A3.js new file mode 100644 index 000000000..f7b28f46e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/08_Types/8.1_The_Undefined_Type/S8.1_A3.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S8.1_A3; + * @section: 8.1; + * @assertion: undefined is now non-writable in es5; + * @description: "undefined=1" should throw a TypeError; +*/ + +////////////////////////////////////////////////////////// +// CHECK1# +var undefined = 1; +// +////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/08_Types/8.1_The_Undefined_Type/S8.1_A4.js b/external/contributions/Google/sputniktests/tests/Conformance/08_Types/8.1_The_Undefined_Type/S8.1_A4.js new file mode 100644 index 000000000..11ea38cf4 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/08_Types/8.1_The_Undefined_Type/S8.1_A4.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S8.1_A4; + * @section: 8.1; + * @assertion: If property of object not exist, return undefined; + * @description: Check value of not existed property; +*/ + +// CHECK#1 +if ((new Object()).newProperty !== undefined) { + $ERROR('#1: (new Object()).newProperty === undefined. Actual: ' + ((new Object()).newProperty)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/08_Types/8.1_The_Undefined_Type/S8.1_A5.js b/external/contributions/Google/sputniktests/tests/Conformance/08_Types/8.1_The_Undefined_Type/S8.1_A5.js new file mode 100644 index 000000000..b877f1fa8 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/08_Types/8.1_The_Undefined_Type/S8.1_A5.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: S8.1_A5; + * @section: 8.1; + * @assertion: Function argument that isn't provided has a value of undefined; + * @description: Call function without provided argument; +*/ + +/////////////////////////////////////// +// +function test(arg) { +// Check and make sure that arg is not undefined + if (typeof(arg) !== "undefined") { + $ERROR('#1: Function argument that isn\'t provided has a value of undefined. Actual: ' + (typeof(arg))); + } +} + +test(); +// +//////////////////////////////////////// |