diff options
Diffstat (limited to 'external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring')
42 files changed, 937 insertions, 0 deletions
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A10.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A10.js new file mode 100644 index 000000000..ec221879b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A10.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: S15.5.4.15_A10; +* @section: 15.5.4.15; +* @assertion: The String.prototype.substring.length property has the attribute ReadOnly; +* @description: Checking if varying the String.prototype.substring.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.substring.hasOwnProperty('length'))) { + $FAIL('#1: String.prototype.substring.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.substring.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +var __obj = String.prototype.substring.length; + +String.prototype.substring.length = function(){return "shifted";}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.substring.length !== __obj) { + $ERROR('#2: __obj = String.prototype.substring.length; String.prototype.substring.length = function(){return "shifted";}; String.prototype.substring.length === __obj. Actual: '+String.prototype.substring.length ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A11.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A11.js new file mode 100644 index 000000000..55d957b51 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A11.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: S15.5.4.15_A11; +* @section: 15.5.4.15; +* @assertion: The length property of the substring method is 2; +* @description: Checking String.prototype.substring.length; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.substring.hasOwnProperty("length"))) { + $ERROR('#1: String.prototype.substring.hasOwnProperty("length") return true. Actual: '+String.prototype.substring.hasOwnProperty("length")); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.substring.length !== 2) { + $ERROR('#2: String.prototype.substring.length === 2. Actual: '+String.prototype.substring.length ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T1.js new file mode 100644 index 000000000..e1cb20248 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T1.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: S15.5.4.15_A1_T1; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end); +* @description: Arguments are false and true, and instance is object; +*/ + +var __instance = new Object(true); + +__instance.substring = String.prototype.substring; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.substring(false, true) !== "t") { + $ERROR('#1: __instance = new Object(true); __instance.substring = String.prototype.substring; __instance.substring(false, true) === "t". Actual: '+__instance.substring(false, true) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T10.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T10.js new file mode 100644 index 000000000..03dd87388 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T10.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: S15.5.4.15_A1_T10; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end); +* @description: Arguments are object and function call, and instance is String, object have overrided valueOf function; +*/ + +var __obj = {valueOf:function(){return 2;}}; + +var __str = "\u0035ABBBABAB"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__str){ + if (substring(__obj, function(){return substring(0,1);}()) !== "BBB") { + $ERROR('#1: var __obj = {valueOf:function(){return 2;}}; var __str = "\u0035ABBBABAB"; substring(__obj, function(){return substring(0,1);}()) === "BBB". Actual: '+substring(__obj, function(){return substring(0,1);}()) ); + } +} +// +////////////////////////////////////////////////////////////////////////////// + +var x; diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T11.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T11.js new file mode 100644 index 000000000..b4389b0d2 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T11.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: S15.5.4.15_A1_T11; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end); +* @description: Arguments are objects, and instance is string, objects have overrided valueOf function, that return exception; +*/ + +var __obj = {valueOf:function(){throw "instart";}}; +var __obj2 = {valueOf:function(){throw "inend";}}; +var __str = {str__:"ABB\u0041BABAB"}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__str){ + with(str__){ + try { + var x = substring(__obj,__obj2); + $FAIL('#1: "var x = substring(__obj,__obj2)" lead to throw exception'); + } catch (e) { + if (e!=="instart") { + $ERROR('#1.1: Exception === "instart". Actual: '+e); + } + } + } +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T12.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T12.js new file mode 100644 index 000000000..124e74863 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T12.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: S15.5.4.15_A1_T12; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end); +* @description: Arguments are objects, and instance is string. +* First object have overrided valueOf function and toString function, that return exception. +* Second object have overrided valueOf function, that return exception; +*/ + +var __obj = {valueOf:function(){return {};}, toString:function(){throw "instart";}}; +var __obj2 = {valueOf:function(){throw "inend";}}; +var __str = new String("ABB\u0041BABAB"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__str){ + try { + var x = substring(__obj, __obj2); + $FAIL('#1: "var x = substring(__obj,__obj2)" lead to throw exception'); + } catch (e) { + if (e!=="instart") { + $ERROR('#1.1: Exception ==="instart". Actual: '+e); + } + } +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T13.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T13.js new file mode 100644 index 000000000..00996cbf3 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T13.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.4.15_A1_T13; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end); +* @description: Arguments are objects, and instance is string. +* First object have overrided valueOf and toString functions. +* Second object have overrided toString function, that return exception; +*/ + +var __obj = {valueOf:function(){return {};}, toString:function(){return 1;}}; +var __obj2 = {toString:function(){throw "inend";}}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +try { + var x = "ABB\u0041BABAB\u0031BBAA".substring(__obj, __obj2); + $FAIL('#1: var x = "ABB\\u0041BABAB\\u0031BBAA".substring(__obj,__obj2) lead to throw exception'); +} catch (e) { + if (e!=="inend") { + $ERROR('#1.1: Exception === "inend". Actual: '+e); + } +} +// +////////////////////////////////////////////////////////////////////////////// + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T14.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T14.js new file mode 100644 index 000000000..28d45bf99 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T14.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.4.15_A1_T14; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end); +* @description: Used one argument, that is function(){}(). Instance is string; +*/ + + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ("report".substring(function(){}()) !== "report") { + $ERROR('#1: "report".substring(function(){}()) === "report". Actual: '+"report".substring(function(){}()) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T15.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T15.js new file mode 100644 index 000000000..3b8434714 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T15.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: S15.5.4.15_A1_T15; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end); +* @description: Call substring without arguments. Instance is Number with prototype.substring = String.prototype.substring; +*/ + +var __num = 11.001002; + +Number.prototype.substring = String.prototype.substring; + + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__num.substring()!=="11.001002") { + $ERROR('#1: var __num = 11.001002; Number.prototype.substring = String.prototype.substring; __num.substring()==="11.001002". Actual: '+__num.substring()); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T2.js new file mode 100644 index 000000000..b8a034fc6 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T2.js @@ -0,0 +1,23 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.4.15_A1_T2; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end); +* @description: Arguments are function call and x, and instance is Boolean. x is undefined variable; +*/ + +var __instance = new Boolean; + +__instance.substring = String.prototype.substring; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.substring(function(){return true;}(),x) !== "alse") { + $ERROR('#1: var x; __instance = new Boolean; __instance.substring = String.prototype.substring; __instance.substring(function(){return true;}(),x) === "alse". Actual: '+__instance.substring(function(){return true;}(),x) ); +} +// +////////////////////////////////////////////////////////////////////////////// + +var x; diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T3.js new file mode 100644 index 000000000..8122cc79e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_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: S15.5.4.15_A1_T3; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end); +* @description: Checking by using eval; +*/ + +var substring = String.prototype.substring; + +if (typeof toString === "undefined"){ + toString = Object.prototype.toString; +} + +var __class__ = toString(); +var __toggle = 1; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (substring(eval("\"1\""),{valueOf:function(){return "0x0007"}})!=="object") { + $ERROR('#1: substring(eval("\\"1\\""),{valueOf:function(){return "0x0007"}})==="object". Actual: '+substring(eval("\"1\""),{valueOf:function(){return "0x0007"}})); +}; +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T4.js new file mode 100644 index 000000000..5fec6a2b6 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T4.js @@ -0,0 +1,17 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.4.15_A1_T4; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end); +* @description: Arguments are null and number, and instance is function call, that returned string; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (function(){return "gnulluna"}().substring(null, -3) !== "") { + $ERROR('#1: function(){return "gnulluna"}().substring(null, -3) === "". Actual: '+function(){return "gnulluna"}().substring(null, -3) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T5.js new file mode 100644 index 000000000..a717af019 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T5.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: S15.5.4.15_A1_T5; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end); +* @description: Arguments are null and Function(), and instance is function object, that have overrided valueOf function; +*/ + +__func.valueOf=function(){return "gnulluna"}; + +Function.prototype.substring=String.prototype.substring; + + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__func.substring(null, Function()) !== "") { + $ERROR('#1: __func.valueOf=function(){return "gnulluna"}; Function.prototype.substring=String.prototype.substring; function __func(){}; __func.substring(null, Function()) === "". Actual: '+__func.substring(null, Function()) ); +} +// +////////////////////////////////////////////////////////////////////////////// + +function __func(){}; diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T6.js new file mode 100644 index 000000000..2e2fa7b71 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T6.js @@ -0,0 +1,19 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.4.15_A1_T6; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end); +* @description: Arguments are x and number, and instance is new String, x is undefined variable; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (new String("undefined").substring(x,3) !== "und") { + $ERROR('#1: var x; new String("undefined").substring(x,3) === "und". Actual: '+new String("undefined").substring(x,3) ); +} +// +////////////////////////////////////////////////////////////////////////////// + +var x; diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T7.js new file mode 100644 index 000000000..90c65cf2b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T7.js @@ -0,0 +1,17 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.4.15_A1_T7; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end); +* @description: Arguments are symbol and undefined, and instance is String; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String(void 0).substring("e",undefined) !== "undefined") { + $ERROR('#1: String(void 0).substring("e",undefined) === "undefined". Actual: '+String(void 0).substring("e",undefined) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T8.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T8.js new file mode 100644 index 000000000..d806867b6 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T8.js @@ -0,0 +1,19 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.4.15_A1_T8; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end); +* @description: Arguments are negative number and void 0, and instance is String(object), object have overrided toString function; +*/ + +var __obj = {toString:function(){}}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String(__obj).substring(-4,void 0) !== "undefined") { + $ERROR('#1: __obj = {toString:function(){}}; String(__obj).substring(-4,void 0) === "undefined". Actual: '+String(__obj).substring(-4,void 0) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T9.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T9.js new file mode 100644 index 000000000..b5debd1c4 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A1_T9.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: S15.5.4.15_A1_T9; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end); +* @description: Arguments are undefined and object, and instance is new String(object), object have overrided valueOf and toString functions; +*/ + +var __obj = { + valueOf:function(){}, + toString:void 0 +}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (new String(__obj).substring(/*(function(){})()*/undefined,undefined) !== "undefined") { + $ERROR('#1: __obj = {valueOf:function(){}, toString:void 0}; new String(__obj).substring(/*(function(){})()*/undefined,undefined) === "undefined". Actual: '+new String(__obj).substring(/*(function(){})()*/undefined,undefined) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A2_T1.js new file mode 100644 index 000000000..e9cfad4ea --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A2_T1.js @@ -0,0 +1,19 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.4.15_A2_T1; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) returns a string value(not object); +* @description: Checking type of substring(); +*/ + +var __string = new String("this is a string object"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (typeof __string.substring() !== "string") { + $ERROR('#1: __string = new String("this is a string object"); typeof __string.substring() === "string". Actual: '+typeof __string.substring() ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A2_T10.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A2_T10.js new file mode 100644 index 000000000..8049952da --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A2_T10.js @@ -0,0 +1,19 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.4.15_A2_T10; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) returns a string value(not object); +* @description: start is 0, end is 8; +*/ + +var __string = new String("this_is_a_string object"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.substring(0,8) !== "this_is_") { + $ERROR('#1: __string = new String("this_is_a_string object"); __string.substring(0,8) === "this_is_". Actual: '+__string.substring(0,8) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A2_T2.js new file mode 100644 index 000000000..a8e5f4523 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A2_T2.js @@ -0,0 +1,19 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.4.15_A2_T2; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) returns a string value(not object); +* @description: start is NaN, end is Infinity; +*/ + +var __string = new String('this is a string object'); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.substring(NaN, Infinity) !== "this is a string object") { + $ERROR('#1: __string = new String(\'this is a string object\'); __string.substring(NaN, Infinity) === "this is a string object". Actual: '+__string.substring(NaN, Infinity) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A2_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A2_T3.js new file mode 100644 index 000000000..99f3e12b6 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A2_T3.js @@ -0,0 +1,19 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.4.15_A2_T3; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) returns a string value(not object); +* @description: Call substring from empty String object; +*/ + +var __string = new String(""); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.substring(1,0) !== "") { + $ERROR('#1: __string = new String(""); __string.substring(1,0) === "". Actual: '+__string.substring(1,0) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A2_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A2_T4.js new file mode 100644 index 000000000..93a464173 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A2_T4.js @@ -0,0 +1,19 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.4.15_A2_T4; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) returns a string value(not object); +* @description: start is Infinity, end is NaN; +*/ + +var __string = new String("this is a string object"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.substring(Infinity, NaN) !== "this is a string object") { + $ERROR('#1: __string = new String("this is a string object"); __string.substring(Infinity, NaN) === "this is a string object". Actual: '+__string.substring(Infinity, NaN) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A2_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A2_T5.js new file mode 100644 index 000000000..17c1253ad --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A2_T5.js @@ -0,0 +1,19 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.4.15_A2_T5; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) returns a string value(not object); +* @description: start is Infinity, end is Infinity; +*/ + +var __string = new String("this is a string object"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.substring(Infinity, Infinity) !== "") { + $ERROR('#1: __string = new String("this is a string object"); __string.substring(Infinity, Infinity) === "". Actual: '+__string.substring(Infinity, Infinity) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A2_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A2_T6.js new file mode 100644 index 000000000..85b568386 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A2_T6.js @@ -0,0 +1,19 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.4.15_A2_T6; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) returns a string value(not object); +* @description: start is negative float number, end is 0; +*/ + +var __string = new String("this is a string object"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.substring(-0.01,0) !== "") { + $ERROR('#1: __string = new String("this is a string object"); __string.substring(-0.01,0) === "". Actual: '+__string.substring(-0.01,0) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A2_T7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A2_T7.js new file mode 100644 index 000000000..286adb720 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A2_T7.js @@ -0,0 +1,19 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.4.15_A2_T7; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) returns a string value(not object); +* @description: start is tested_string.length, end is tested_string.length; +*/ + +var __string = new String("this is a string object"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.substring(__string.length, __string.length) !== "") { + $ERROR('#1: __string = new String("this is a string object"); __string.substring(__string.length, __string.length) === "". Actual: '+__string.substring(__string.length, __string.length) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A2_T8.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A2_T8.js new file mode 100644 index 000000000..cc1638439 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A2_T8.js @@ -0,0 +1,19 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.4.15_A2_T8; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) returns a string value(not object); +* @description: start is tested_string.length+1, end is 0; +*/ + +var __string = new String("this is a string object"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.substring(__string.length+1, 0) !== "this is a string object") { + $ERROR('#1: __string = new String("this is a string object"); __string.substring(__string.length+1, 0) === "this is a string object". Actual: '+__string.substring(__string.length+1, 0) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A2_T9.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A2_T9.js new file mode 100644 index 000000000..a28f052a9 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A2_T9.js @@ -0,0 +1,19 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.4.15_A2_T9; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) returns a string value(not object); +* @description: start is -Infinity, end is -Infinity; +*/ + +var __string = new String("this is a string object"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.substring(-Infinity, -Infinity) !== "") { + $ERROR('#1: __string = new String("this is a string object"); __string.substring(-Infinity, -Infinity) === "". Actual: '+__string.substring(-Infinity, -Infinity) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T1.js new file mode 100644 index 000000000..51ebb337c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T1.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: S15.5.4.15_A3_T1; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) can be applied to non String object instance and +* returns a string value(not object); +* @description: Apply String.prototype.substring to Array instance. Start is Infinity, end is -Infinity; +*/ + +var __instance = new Array(1,2,3,4,5); +__instance.substring = String.prototype.substring; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.substring(Infinity,-Infinity) !== "1,2,3,4,5") { + $ERROR('#1: __instance = new Array(1,2,3,4,5); __instance.substring = String.prototype.substring; __instance.substring(Infinity,-Infinity) === "1,2,3,4,5". Actual: '+__instance.substring(Infinity,-Infinity) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T10.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T10.js new file mode 100644 index 000000000..d457e3769 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T10.js @@ -0,0 +1,27 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.4.15_A3_T10; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) can be applied to non String object instance and +* returns a string value(not object); +* @description: Checknig if applying String.prototype.substring to Function object instance passes; +*/ + +__FACTORY.prototype.substring = String.prototype.substring; + +var __instance = new __FACTORY(void 0); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.substring(0, 100) !== "undefined") { + $ERROR('#1: __instance.substring(0, 100) === "undefined". Actual: '+__instance.substring(0, 100) ); +} +// +////////////////////////////////////////////////////////////////////////////// + +function __FACTORY( value ) { + this.value = value; + this.toString = function() { return this.value+''; } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T11.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T11.js new file mode 100644 index 000000000..f991069c2 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T11.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: S15.5.4.15_A3_T11; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) can be applied to non String object instance and +* returns a string value(not object); +* @description: Apply String.prototype.substring to Boolean instance. Start is new Array(), end is new Boolean(1); +*/ + +var __instance = new Boolean(); + +__instance.substring = String.prototype.substring; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.substring(new Array(), new Boolean(1)) !== "f") { + $ERROR('#1: __instance = new Boolean(); __instance.substring = String.prototype.substring; __instance.substring(new Array(), new Boolean(1)) === "f". Actual: '+__instance.substring(new Array(), new Boolean(1)) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T2.js new file mode 100644 index 000000000..f80f3f645 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T2.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: S15.5.4.15_A3_T2; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) can be applied to non String object instance and +* returns a string value(not object); +* @description: Apply String.prototype.substring to Array instance. Start is 9, end is -Infinity; +*/ + +var __instance = new Array(1,2,3,4,5); +__instance.substring = String.prototype.substring; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.substring(9,-Infinity) !== "1,2,3,4,5") { + $ERROR('#1: __instance = new Array(1,2,3,4,5); __instance.substring = String.prototype.substring; __instance.substring(9,-Infinity) === "1,2,3,4,5". Actual: '+__instance.substring(9,-Infinity) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T3.js new file mode 100644 index 000000000..ab9f7f6c8 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_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: S15.5.4.15_A3_T3; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) can be applied to non String object instance and +* returns a string value(not object); +* @description: Apply String.prototype.substring to Array instance. Start is true, end is false; +*/ + +var __instance = new Array(1,2,3,4,5); +__instance.substring = String.prototype.substring; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.substring(true, false) !== "1") { + $ERROR('#1: __instance = new Array(1,2,3,4,5); __instance.substring = String.prototype.substring; __instance.substring(true, false) === "1". Actual: '+__instance.substring(true, false) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T4.js new file mode 100644 index 000000000..a4983fa84 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T4.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: S15.5.4.15_A3_T4; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) can be applied to non String object instance and +* returns a string value(not object); +* @description: Apply String.prototype.substring to Array instance. Start is '4', end is '5'; +*/ + +var __instance = new Array(1,2,3,4,5); +__instance.substring = String.prototype.substring; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.substring('4', '5') !== "3") { + $ERROR('#1: __instance = new Array(1,2,3,4,5); __instance.substring = String.prototype.substring; __instance.substring(\'4\', \'5\') === "3". Actual: '+__instance.substring('4', '5') ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T5.js new file mode 100644 index 000000000..12b8722d1 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T5.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: S15.5.4.15_A3_T5; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) can be applied to non String object instance and +* returns a string value(not object); +* @description: Apply String.prototype.substring to Object instance. Start is 8, end is 0; +*/ + +var __instance = new Object(); +__instance.substring = String.prototype.substring; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.substring(8,0) !== "[object ") { + $ERROR('#1: __instance = new Object(); __instance.substring = String.prototype.substring; __instance.substring(8,0) === "[object ". Actual: '+__instance.substring(8,0) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T6.js new file mode 100644 index 000000000..4b5a40c59 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T6.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: S15.5.4.15_A3_T6; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) can be applied to non String object instance and +* returns a string value(not object); +* @description: Apply String.prototype.substring to Object instance. Start is 8, end is length of object.toString; +*/ + +var __instance = new Object(); +__instance.substring = String.prototype.substring; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.substring(8, __instance.toString().length) !== "Object]") { + $ERROR('#1: __instance = new Object(); __instance.substring = String.prototype.substring; __instance.substring(8, __instance.toString().length) === "Object]". Actual: '+__instance.substring(8, __instance.toString().length) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T7.js new file mode 100644 index 000000000..a8696c579 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T7.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: S15.5.4.15_A3_T7; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) can be applied to non String object instance and +* returns a string value(not object); +* @description: Apply String.prototype.substring to Object instance. Call instance.substring(...).substring(...); +*/ + +var __instance = function(){}; + +__instance.substring = String.prototype.substring; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.substring(-Infinity,8) !== "function") { + $ERROR('#1: __instance = function(){}; __instance.substring = String.prototype.substring; __instance.substring(-Infinity,8) === "function". Actual: '+__instance.substring(8,Infinity).substring(-Infinity,1) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T8.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T8.js new file mode 100644 index 000000000..0e5fcc1bf --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T8.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: S15.5.4.15_A3_T8; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) can be applied to non String object instance and +* returns a string value(not object); +* @description: Apply String.prototype.substring to Number instance. Start is Infinity, end is NaN; +*/ + +var __instance = new Number(NaN); + +__instance.substring = String.prototype.substring; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.substring(Infinity, NaN) !== "NaN") { + $ERROR('#1: __instance = new Number(NaN); __instance.substring = String.prototype.substring; __instance.substring(Infinity, NaN) === "NaN". Actual: '+__instance.substring(Infinity, NaN) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T9.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T9.js new file mode 100644 index 000000000..2bfef21a9 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A3_T9.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: S15.5.4.15_A3_T9; +* @section: 15.5.4.15; +* @assertion: String.prototype.substring (start, end) can be applied to non String object instance and +* returns a string value(not object); +* @description: Apply String.prototype.substring to Math instance. Start is Math.PI, end is -10; +*/ + +var __instance = Math; + +__instance.substring = String.prototype.substring; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.substring(Math.PI, -10) !== "[ob") { + $ERROR('#1: __instance = Math; __instance.substring = String.prototype.substring; __instance.substring(Math.PI, -10) === "[ob". Actual: '+__instance.substring(Math.PI, -10) ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A6.js new file mode 100644 index 000000000..4f1e52ead --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A6.js @@ -0,0 +1,17 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.4.15_A6; +* @section: 15.5.4.15, 13.2; +* @assertion: String.prototype.substring has not prototype property; +* @description: Checking String.prototype.substring.prototype; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String.prototype.substring.prototype !== undefined) { + $ERROR('#1: String.prototype.substring.prototype === undefined. Actual: '+String.prototype.substring.prototype ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A7.js new file mode 100644 index 000000000..78a791d3b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A7.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: S15.5.4.15_A7; +* @section: 15.5.4.15, 13.2; +* @assertion: String.prototype.substring can't be used as constructor; +* @description: Checking if creating the String.prototype.substring object fails; +*/ + +var __FACTORY = String.prototype.substring; + +try { + var __instance = new __FACTORY; + $FAIL('#1: __FACTORY = String.prototype.substring; "__instance = new __FACTORY" lead to throwing exception'); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: undefined = 1 throw a TypeError. Actual: ' + (e)); + } + $PRINT(e); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A8.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A8.js new file mode 100644 index 000000000..1ce7cd13f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A8.js @@ -0,0 +1,40 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.4.15_A8; +* @section: 15.5.4.15; +* @assertion: The String.prototype.substring.length property has the attribute DontEnum; +* @description: Checking if enumerating the String.prototype.substring.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.substring.hasOwnProperty('length'))) { + $FAIL('#0: String.prototype.substring.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.substring.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////// +// CHECK#1 +if (String.prototype.substring.propertyIsEnumerable('length')) { + $ERROR('#1: String.prototype.substring.propertyIsEnumerable(\'length\') return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +// CHECK#2 +var count=0; + +for (var p in String.prototype.substring){ + if (p==="length") count++; +} + +if (count !== 0) { + $ERROR('#2: count=0; for (p in String.prototype.substring){if (p==="length") count++;} count === 0. Actual: '+count ); +} +// +////////////////////////////////////////////////////////////////////////////// diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A9.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A9.js new file mode 100644 index 000000000..4a947b2e2 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.5_String_Objects/15.5.4_Properties_of_the_String_Prototype_Object/15.5.4.15_String.prototype.substring/S15.5.4.15_A9.js @@ -0,0 +1,33 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.5.4.15_A9; +* @section: 15.5.4.15; +* @assertion: The String.prototype.substring.length property has the attribute DontDelete; +* @description: Checking if deleting the String.prototype.substring.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.substring.hasOwnProperty('length'))) { + $FAIL('#0: String.prototype.substring.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.substring.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (delete String.prototype.substring.length) { + $ERROR('#1: delete String.prototype.substring.length return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (!(String.prototype.substring.hasOwnProperty('length'))) { + $FAIL('#2: delete String.prototype.substring.length; String.prototype.substring.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.substring.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// |