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.10_String.prototype.match')
38 files changed, 1312 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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A10.js new file mode 100644 index 000000000..214070e6f --- /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.10_String.prototype.match/S15.5.4.10_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.10_A10; +* @section: 15.5.4.10; +* @assertion: The String.prototype.match.length property has the attribute ReadOnly; +* @description: Checking if varying the String.prototype.match.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.match.hasOwnProperty('length'))) { + $FAIL('#1: String.prototype.match.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.match.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +var __obj = String.prototype.match.length; + +String.prototype.match.length = function(){return "shifted";}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.match.length !== __obj) { + $ERROR('#2: __obj = String.prototype.match.length; String.prototype.match.length = function(){return "shifted";}; String.prototype.match.length === __obj. Actual: '+String.prototype.match.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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A11.js new file mode 100644 index 000000000..29ce3ba56 --- /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.10_String.prototype.match/S15.5.4.10_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.10_A11; +* @section: 15.5.4.10; +* @assertion: The length property of the match method is 1; +* @description: Checking String.prototype.match.length; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(String.prototype.match.hasOwnProperty("length"))) { + $ERROR('#1: String.prototype.match.hasOwnProperty("length") return true. Actual: '+String.prototype.match.hasOwnProperty("length")); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (String.prototype.match.length !== 1) { + $ERROR('#2: String.prototype.match.length === 1. Actual: '+String.prototype.match.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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A1_T1.js new file mode 100644 index 000000000..42ea69ecc --- /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.10_String.prototype.match/S15.5.4.10_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.10_A1_T1; +* @section: 15.5.4.10; +* @assertion: String.prototype.match (regexp); +* @description: Arguments is true, and instance is object; +*/ + +var __instance = new Object(true); + +__instance.match = String.prototype.match; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.match(true)[0] !== "true") { + $ERROR('#1: __instance = new Object(true); __instance.match = String.prototype.match; __instance.match(true)[0] === "true". Actual: '+__instance.match(true)[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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A1_T10.js new file mode 100644 index 000000000..e75726da3 --- /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.10_String.prototype.match/S15.5.4.10_A1_T10.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.10_A1_T10; +* @section: 15.5.4.10; +* @assertion: String.prototype.match (regexp); +* @description: Call match (regexp) function with object argument; +*/ + +var __obj = {toString:function(){return "\u0041B";}} +var __str = "ABB\u0041BABAB"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__str){ + if (match(__obj)[0] !=="AB") { + $ERROR('#1: var x; var __obj = {toString:function(){return "\u0041B";}}; var __str = "ABB\u0041BABAB"; match(__obj)[0] ==="AB". Actual: '+match(__obj)[0] ); + } +} +// +////////////////////////////////////////////////////////////////////////////// + +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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A1_T11.js new file mode 100644 index 000000000..c6edbfac9 --- /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.10_String.prototype.match/S15.5.4.10_A1_T11.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.10_A1_T11; +* @section: 15.5.4.10; +* @assertion: String.prototype.match (regexp); +* @description: Override toString function, toString throw exception, then call match (regexp) function with this object as argument; +*/ + +var __obj = {toString:function(){throw "intostr";}} +var __str = {str__:"ABB\u0041BABAB"}; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__str){ + with(str__){ + try { + var x = match(__obj); + $FAIL('#1: "var x = match(__obj)" lead to throwing exception'); + } catch (e) { + if (e!=="intostr") { + $ERROR('#1.1: Exception === "intostr". 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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A1_T12.js new file mode 100644 index 000000000..1fbfae4f8 --- /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.10_String.prototype.match/S15.5.4.10_A1_T12.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.10_A1_T12; +* @section: 15.5.4.10; +* @assertion: String.prototype.match (regexp); +* @description: Override toString and valueOf functions, valueOf throw exception, then call match (regexp) function with this object as argument; +*/ + +var __obj = {toString:function(){return {};},valueOf:function(){throw "intostr";}} +var __str = new String("ABB\u0041BABAB"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +with(__str){ + try { + var x = match(__obj); + $FAIL('#1: "var x = match(__obj)" lead to throwing exception'); + } catch (e) { + if (e!=="intostr") { + $ERROR('#1.1: Exception === "intostr". 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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A1_T13.js new file mode 100644 index 000000000..840a3645f --- /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.10_String.prototype.match/S15.5.4.10_A1_T13.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.10_A1_T13; +* @section: 15.5.4.10; +* @assertion: String.prototype.match (regexp); +* @description: Override toString and valueOf functions, then call match (regexp) function with this object as argument; +*/ + +var __obj = {toString:function(){return {};},valueOf:function(){return 1;}} + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ("ABB\u0041B\u0031ABAB\u0031BBAA".match(__obj)[0] !=="1") { + $ERROR('#1: var __obj = {toString:function(){return {};},valueOf:function(){return 1;}}; "ABB\\u0041B\\u0031ABAB\\u0031BBAA".match(__obj)[0] ==="1". Actual: '+("ABB\u0041B\u0031ABAB\u0031BBAA".match(__obj)[0]) ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if ("ABB\u0041B\u0031ABAB\u0031BBAA".match(__obj).length !== 1) { + $ERROR('#3: var __obj = {toString:function(){return {};},valueOf:function(){return 1;}}; "ABB\\u0041B\\u0031ABAB\\u0031BBAA".match(__obj).length === 1. Actual: '+("ABB\u0041B\u0031ABAB\u0031BBAA".match(__obj).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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A1_T14.js new file mode 100644 index 000000000..56c307d3a --- /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.10_String.prototype.match/S15.5.4.10_A1_T14.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.10_A1_T14; +* @section: 15.5.4.10; +* @assertion: String.prototype.match (regexp); +* @description: Call match (regexp) function with RegExp object as argument from string; +*/ + +var __reg = new RegExp("77"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if ("ABB\u0041BABAB\u0037\u0037BBAA".match(__reg)[0] !== "77") { + $ERROR('#1: var __reg = new RegExp("77"); "ABB\\u0041BABAB\\u0037\\u0037BBAA".match(__reg)[0] === "77". Actual: '+("ABB\u0041BABAB\u0037\u0037BBAA".match(__reg)[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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A1_T2.js new file mode 100644 index 000000000..4a8f3b012 --- /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.10_String.prototype.match/S15.5.4.10_A1_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.10_A1_T2; +* @section: 15.5.4.10; +* @assertion: String.prototype.match (regexp); +* @description: Argument is function that return boolean, and instance is Boolean object; +*/ + +var __instance = new Boolean; + +__instance.match = String.prototype.match; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__instance.match(function(){return false;}())[0] !== "false") { + $ERROR('#1: __instance = new Boolean; __instance.match = String.prototype.match; __instance.match(function(){return false;}())[0] === "false". Actual: '+__instance.match(function(){return false;}())[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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A1_T3.js new file mode 100644 index 000000000..c059fa4b4 --- /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.10_String.prototype.match/S15.5.4.10_A1_T3.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.10_A1_T3; +* @section: 15.5.4.10; +* @assertion: String.prototype.match (regexp); +* @description: Checking by using eval; +*/ + +var match = String.prototype.match; + +if (typeof toString === "undefined"){ + toString = Object.prototype.toString; +} + +var __class__ = toString(); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (match(eval("\"bj\""))[0] !== "bj") { + $ERROR('#1: match = String.prototype.match; match(eval("\\"bj\\""))[0] === "bj". Actual: '+match(eval("\"bj\""))[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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A1_T4.js new file mode 100644 index 000000000..42b6f6331 --- /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.10_String.prototype.match/S15.5.4.10_A1_T4.js @@ -0,0 +1,47 @@ +// 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.10_A1_T4; +* @section: 15.5.4.10; +* @assertion: String.prototype.match (regexp); +* @description: Call match (regexp) function without arguments of string; +*/ + +var __matched = "".match(); + +var __expected = RegExp().exec(""); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__matched.length !== __expected.length) { + $ERROR('#1: __matched = "".match(); __expected = RegExp().exec(""); __matched.length === __expected.length. Actual: '+__matched.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__matched.index !== __expected.index) { + $ERROR('#2: __matched = "".match(); __expected = RegExp().exec(""); __matched.index === __expected.index. Actual: '+__matched.index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__matched.input !== __expected.input) { + $ERROR('#3: __matched = "".match(); __expected = RegExp().exec(""); __matched.input === __expected.input. Actual: '+__matched.input ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__matched[index]!==__expected[index]) { + $ERROR('#4.'+index+': __matched = "".match(); __expected = RegExp().exec(""); __matched['+index+']===__expected['+index+']. Actual: '+__matched[index]); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A1_T5.js new file mode 100644 index 000000000..3a8da5dad --- /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.10_String.prototype.match/S15.5.4.10_A1_T5.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.10_A1_T5; +* @section: 15.5.4.10; +* @assertion: String.prototype.match (regexp); +* @description: Call match (regexp) function with null argument of function object; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +//since ToString(null) evaluates to "null" match(null) evaluates to match("null") +if (function(){return "gnulluna"}().match(null)[0] !== "null") { + $ERROR('#1: function(){return "gnulluna"}().match(null)[0] === "null". Actual: '+function(){return "gnulluna"}().match(null)[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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A1_T6.js new file mode 100644 index 000000000..31a679592 --- /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.10_String.prototype.match/S15.5.4.10_A1_T6.js @@ -0,0 +1,50 @@ +// 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.10_A1_T6; +* @section: 15.5.4.10; +* @assertion: String.prototype.match (regexp); +* @description: Call match (regexp) function with x argument of new String object, where x is undefined variable; +*/ + +var __matched = new String("undefined").match(x); + +var __expected = RegExp(x).exec("undefined"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__matched.length !== __expected.length) { + $ERROR('#1: __matched = new String("undefined").match(x); __expected = RegExp(x).exec("undefined"); __matched.length === __expected.length. Actual: '+__matched.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__matched.index !== __expected.index) { + $ERROR('#2: __matched = new String("undefined").match(x); __expected = RegExp(x).exec("undefined"); __matched.index === __expected.index. Actual: '+__matched.index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__matched.input !== __expected.input) { + $ERROR('#3: __matched = new String("undefined").match(x); __expected = RegExp(x).exec("undefined"); __matched.input === __expected.input. Actual: '+__matched.input ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__matched[index]!==__expected[index]) { + $ERROR('#4.'+index+': __matched = new String("undefined").match(x); __expected = RegExp(x).exec("undefined"); __matched['+index+']===__expected['+index+']. Actual: '+__matched[index]); + } +} +// +////////////////////////////////////////////////////////////////////////////// + +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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A1_T7.js new file mode 100644 index 000000000..0cd7c0a8a --- /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.10_String.prototype.match/S15.5.4.10_A1_T7.js @@ -0,0 +1,47 @@ +// 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.10_A1_T7; +* @section: 15.5.4.10; +* @assertion: String.prototype.match (regexp); +* @description: Call match (regexp) function with undefined argument of string object; +*/ + +var __matched = String("undefined").match(undefined); + +var __expected = RegExp(undefined).exec("undefined"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__matched.length !== __expected.length) { + $ERROR('#1: __matched = String("undefined").match(undefined); __expected = RegExp(undefined).exec("undefined"); __matched.length === __expected.length. Actual: '+__matched.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__matched.index !== __expected.index) { + $ERROR('#2: __matched = String("undefined").match(undefined); __expected = RegExp(undefined).exec("undefined"); __matched.index === __expected.index. Actual: '+__matched.index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__matched.input !== __expected.input) { + $ERROR('#3: __matched = String("undefined").match(undefined); __expected = RegExp(undefined).exec("undefined"); __matched.input === __expected.input. Actual: '+__matched.input ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__matched[index]!==__expected[index]) { + $ERROR('#4.'+index+': __matched = String("undefined").match(undefined); __expected = RegExp(undefined).exec("undefined"); __matched['+index+']===__expected['+index+']. Actual: '+__matched[index]); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A1_T8.js new file mode 100644 index 000000000..7a7022b45 --- /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.10_String.prototype.match/S15.5.4.10_A1_T8.js @@ -0,0 +1,50 @@ +// 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.10_A1_T8; +* @section: 15.5.4.10; +* @assertion: String.prototype.match (regexp); +* @description: Call match (regexp) function with void 0 argument of string object; +* +*/ + +var __obj = {toString:function(){}}; + +var __matched = String(__obj).match(void 0); + +var __expected = RegExp(void 0).exec("undefined"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__matched.length !== __expected.length) { + $ERROR('#1: __obj = {toString:function(){}}; __matched = String(__obj).match(void 0); __expected = RegExp(void 0).exec("undefined"); __matched.length === __expected.length. Actual: '+__matched.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__matched.index !== __expected.index) { + $ERROR('#2: __obj = {toString:function(){}}; __matched = String(__obj).match(void 0); __expected = RegExp(void 0).exec("undefined"); __matched.index === __expected.index. Actual: '+__matched.index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__matched.input !== __expected.input) { + $ERROR('#3: __obj = {toString:function(){}}; __matched = String(__obj).match(void 0); __expected = RegExp(void 0).exec("undefined"); __matched.input === __expected.input. Actual: '+__matched.input ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__matched[index]!==__expected[index]) { + $ERROR('#4.'+index+': __obj = {toString:function(){}}; __matched = String(__obj).match(void 0); __expected = RegExp(void 0).exec("undefined"); __matched['+index+']===__expected['+index+']. Actual: '+__matched[index]); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A1_T9.js new file mode 100644 index 000000000..f08ed7e5c --- /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.10_String.prototype.match/S15.5.4.10_A1_T9.js @@ -0,0 +1,52 @@ +// 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.10_A1_T9; +* @section: 15.5.4.10; +* @assertion: String.prototype.match (regexp); +* @description: Call match (regexp) function with function(){}() argument of string object; +*/ + +var __obj = { + valueOf:function(){}, + toString:void 0 +}; + +var __matched = new String(__obj).match(function(){}()); + +var __expected = RegExp(undefined).exec("undefined"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__matched.length !== __expected.length) { + $ERROR('#1: __obj = {valueOf:function(){}, toString:void 0}; __matched = new String(__obj).match(function(){}()); __expected = RegExp(undefined).exec("undefined"); __matched.length === __expected.length. Actual: '+__matched.length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__matched.index !== __expected.index) { + $ERROR('#2: __obj = {valueOf:function(){}, toString:void 0}; __matched = new String(__obj).match(function(){}()); __expected = RegExp(undefined).exec("undefined"); __matched.index === __expected.index. Actual: '+__matched.index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__matched.input !== __expected.input) { + $ERROR('#3: __obj = {valueOf:function(){}, toString:void 0}; __matched = new String(__obj).match(function(){}()); __expected = RegExp(undefined).exec("undefined"); __matched.input === __expected.input. Actual: '+__matched.input ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +for(var index=0; index<__expected.length; index++) { + if (__matched[index]!==__expected[index]) { + $ERROR('#4.'+index+': __obj = {valueOf:function(){}, toString:void 0}; __matched = new String(__obj).match(function(){}()); __expected = RegExp(undefined).exec("undefined"); __matched['+index+']===__expected['+index+']. Actual: '+__matched[index]); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A2_T1.js new file mode 100644 index 000000000..352ab972b --- /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.10_String.prototype.match/S15.5.4.10_A2_T1.js @@ -0,0 +1,43 @@ +// 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.10_A2_T1; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is 3; +*/ + +var __string = "1234567890"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(3)[0]!== "3") { + $ERROR('#1: __string = "1234567890"; __string.match(3)[0]=== "3". Actual: '+__string.match(3)[0]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__string.match(3).length !==1) { + $ERROR('#2: __string = "1234567890"; __string.match(3).length ===1. Actual: '+__string.match(3).length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__string.match(3).index !==2) { + $ERROR('#3: __string = "1234567890"; __string.match(3).index ===2. Actual: '+__string.match(3).index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__string.match(3).input !==__string) { + $ERROR('#4: __string = "1234567890"; __string.match(3).input ===__string. Actual: '+__string.match(3).input ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A2_T10.js new file mode 100644 index 000000000..8288c459a --- /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.10_String.prototype.match/S15.5.4.10_A2_T10.js @@ -0,0 +1,44 @@ +// 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.10_A2_T10; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /([\d]{5})([-\ ]?[\d]{4})?$/. Last match is undefined. +* And regular expression object have property lastIndex = tested_string.lastIndexOf("0"); +*/ + +var __string = "Boston, MA 02134"; + +var __matches=["02134", "02134", undefined]; + +var __re = /([\d]{5})([-\ ]?[\d]{4})?$/; + +__re.lastIndex = __string.lastIndexOf("0"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(__re).length!== 3) { + $ERROR('#1: __string.match(__re).length=== 3. Actual: '+__string.match(__re).length); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__string.match(__re).index !==__string.lastIndexOf("0")) { + $ERROR('#2: __string.match(__re).index ===__string.lastIndexOf("0"). Actual: '+__string.match(__re).index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for(var mi=0; mi<__matches.length; mi++) { + if (__string.match(__re)[mi]!==__matches[mi]) { + $ERROR('#3.'+mi+': __string.match(__re)['+mi+']===__matches['+mi+']. Actual: '+__string.match(__re)[mi]); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_A2_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.10_String.prototype.match/S15.5.4.10_A2_T11.js new file mode 100644 index 000000000..eff45f6ad --- /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.10_String.prototype.match/S15.5.4.10_A2_T11.js @@ -0,0 +1,44 @@ +// 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.10_A2_T11; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /([\d]{5})([-\ ]?[\d]{4})?$/. Last match is undefined. +* And regular expression object have property lastIndex = tested_string.lastIndexOf("0")+1; +*/ + +var __string = "Boston, MA 02134"; + +var __matches=["02134", "02134", undefined]; + +var __re = /([\d]{5})([-\ ]?[\d]{4})?$/; + +__re.lastIndex = __string.lastIndexOf("0")+1; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(__re).length!== 3) { + $ERROR('#1: __string.match(__re).length=== 3. Actual: '+__string.match(__re).length); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__string.match(__re).index !==__string.lastIndexOf("0")) { + $ERROR('#2: __string.match(__re).index ===__string.lastIndexOf("0"). Actual: '+__string.match(__re).index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for(var mi=0; mi<__matches.length; mi++) { + if (__string.match(__re)[mi]!==__matches[mi]) { + $ERROR('#3.'+mi+': __string.match(__re)['+mi+']===__matches['+mi+']. Actual: '+__string.match(__re)[mi]); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_A2_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.10_String.prototype.match/S15.5.4.10_A2_T12.js new file mode 100644 index 000000000..3f2644904 --- /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.10_String.prototype.match/S15.5.4.10_A2_T12.js @@ -0,0 +1,31 @@ +// 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.10_A2_T12; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is variable that have value /([\d]{5})([-\ ]?[\d]{4})?$/g; +*/ + +var __matches=["02134"]; + +var __string = "Boston, MA 02134"; + +var __re = /([\d]{5})([-\ ]?[\d]{4})?$/g; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(__re).length!== __matches.length) { + $ERROR('#1: __string.match(__re).length=== __matches.length. Actual: '+__string.match(__re).length); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__string.match(__re)[0]!==__matches[0]) { + $ERROR('#2: __string.match(__re)[0]===__matches[0]. Actual: '+__string.match(__re)[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.10_String.prototype.match/S15.5.4.10_A2_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.10_String.prototype.match/S15.5.4.10_A2_T13.js new file mode 100644 index 000000000..8c88fef3f --- /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.10_String.prototype.match/S15.5.4.10_A2_T13.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.10_A2_T13; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /([\d]{5})([-\ ]?[\d]{4})?$/g. +* And regular expression object have property lastIndex = 0; +*/ + +var __matches=["02134"]; + +var __re = /([\d]{5})([-\ ]?[\d]{4})?$/g; +__re.lastIndex = 0; + +var __string = "Boston, MA 02134"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(__re).length!== __matches.length) { + $ERROR('#1: __string.match(__re).length=== __matches.length. Actual: '+__string.match(__re).length); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__string.match(__re)[0]!==__matches[0]) { + $ERROR('#3: __string.match(__re)[0]===__matches[0]. Actual: '+__string.match(__re)[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.10_String.prototype.match/S15.5.4.10_A2_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.10_String.prototype.match/S15.5.4.10_A2_T14.js new file mode 100644 index 000000000..7d35e67f8 --- /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.10_String.prototype.match/S15.5.4.10_A2_T14.js @@ -0,0 +1,34 @@ +// 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.10_A2_T14; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /([\d]{5})([-\ ]?[\d]{4})?$/g. +* And regular expression object have property lastIndex = tested_string.length; +*/ + +var __string = "Boston, MA 02134"; + +var __matches=["02134"]; + +var __re = /([\d]{5})([-\ ]?[\d]{4})?$/g; + +__re.lastIndex = __string.length; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(__re).length!== __matches.length) { + $ERROR('#1: __string.match(__re).length=== __matches.length. Actual: '+__string.match(__re).length); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__string.match(__re)[0]!==__matches[0]) { + $ERROR('#3: __string.match(__re)[0]===__matches[0]. Actual: '+__string.match(__re)[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.10_String.prototype.match/S15.5.4.10_A2_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.10_String.prototype.match/S15.5.4.10_A2_T15.js new file mode 100644 index 000000000..77a25be47 --- /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.10_String.prototype.match/S15.5.4.10_A2_T15.js @@ -0,0 +1,34 @@ +// 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.10_A2_T15; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /([\d]{5})([-\ ]?[\d]{4})?$/. +* And regular expression object have property lastIndex = tested_string.lastIndexOf("0"); +*/ + +var __string = "Boston, MA 02134"; + +var __matches=["02134"]; + +var __re = /([\d]{5})([-\ ]?[\d]{4})?$/g; + +__re.lastIndex = __string.lastIndexOf("0"); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(__re).length!== __matches.length) { + $ERROR('#1: __string.match(__re).length=== __matches.length. Actual: '+__string.match(__re).length); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__string.match(__re)[0]!==__matches[0]) { + $ERROR('#3: __string.match(__re)[0]===__matches[0]. Actual: '+__string.match(__re)[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.10_String.prototype.match/S15.5.4.10_A2_T16.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.10_String.prototype.match/S15.5.4.10_A2_T16.js new file mode 100644 index 000000000..4a02d1f5f --- /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.10_String.prototype.match/S15.5.4.10_A2_T16.js @@ -0,0 +1,34 @@ +// 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.10_A2_T16; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /([\d]{5})([-\ ]?[\d]{4})?$/. +* And regular expression object have property lastIndex = tested_string.lastIndexOf("0")+1; +*/ + +var __string = "Boston, MA 02134"; + +var __matches=["02134"]; + +var __re = /([\d]{5})([-\ ]?[\d]{4})?$/g; + +__re.lastIndex = __string.lastIndexOf("0")+1; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(__re).length!== __matches.length) { + $ERROR('#1: __string.match(__re).length=== __matches.length. Actual: '+__string.match(__re).length); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__string.match(__re)[0]!==__matches[0]) { + $ERROR('#3: __string.match(__re)[0]===__matches[0]. Actual: '+__string.match(__re)[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.10_String.prototype.match/S15.5.4.10_A2_T17.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.10_String.prototype.match/S15.5.4.10_A2_T17.js new file mode 100644 index 000000000..f36e6806a --- /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.10_String.prototype.match/S15.5.4.10_A2_T17.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: S15.5.4.10_A2_T17; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /0./; +*/ + +var __re = /0./; + +var __num = 10203040506070809000; + +Number.prototype.match = String.prototype.match; + +//__matches = ["02"]; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__num.match(__re)[0]!== "02") { + $ERROR('#1: __num.match(__re)[0]=== "02". Actual: '+__num.match(__re)[0]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__num.match(__re).length !==1) { + $ERROR('#2: __num.match(__re).length ===1. Actual: '+__num.match(__re).length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__num.match(__re).index !==1) { + $ERROR('#3: __num.match(__re).index ===1. Actual: '+__num.match(__re).index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__num.match(__re).input !==String(__num)) { + $ERROR('#4: __num.match(__re).input ===String(__num). Actual: '+__num.match(__re).input ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_A2_T18.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.10_String.prototype.match/S15.5.4.10_A2_T18.js new file mode 100644 index 000000000..6756d3a6a --- /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.10_String.prototype.match/S15.5.4.10_A2_T18.js @@ -0,0 +1,50 @@ +// 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.10_A2_T18; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /0./. +* And regular expression object have property lastIndex = 0; +*/ + +var __re = /0./; + +__re.lastIndex = 0; + +var __num = 10203040506070809000; + +Number.prototype.match = String.prototype.match; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__num.match(__re)[0]!== "02") { + $ERROR('#1: __num.match(__re)[0]=== "02". Actual: '+__num.match(__re)[0]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__num.match(__re).length !==1) { + $ERROR('#2: __num.match(__re).length ===1. Actual: '+__num.match(__re).length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__num.match(__re).index !==1) { + $ERROR('#3: __num.match(__re).index ===1. Actual: '+__num.match(__re).index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__num.match(__re).input !==String(__num)) { + $ERROR('#4: __num.match(__re).input ===String(__num). Actual: '+__num.match(__re).input ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A2_T2.js new file mode 100644 index 000000000..ab9ec9a4c --- /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.10_String.prototype.match/S15.5.4.10_A2_T2.js @@ -0,0 +1,31 @@ +// 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.10_A2_T2; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /34/g; +*/ + +var __matches=["34","34","34"]; + +var __string = "343443444"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(/34/g).length!== 3) { + $ERROR('#1: __string = "343443444"; __string.match(/34/g).length=== 3. Actual: '+__string.match(/34/g).length); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +for(var mi=0; mi<__matches.length; mi++) { + if (__string.match(/34/g)[mi]!==__matches[mi]) { + $ERROR('#2.'+mi+': __matches=["34","34","34"]; __string = "343443444"; __string.match(/34/g)['+mi+']===__matches['+mi+']. Actual: '+__string.match(/34/g)[mi]); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A2_T3.js new file mode 100644 index 000000000..f28c5e34f --- /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.10_String.prototype.match/S15.5.4.10_A2_T3.js @@ -0,0 +1,31 @@ +// 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.10_A2_T3; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /\d{1}/g; +*/ + +var __matches=["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]; + +var __string = "123456abcde7890"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(/\d{1}/g).length!== 10) { + $ERROR('#1: __string = "123456abcde7890"; __string.match(/\\d{1}/g).length=== 10. Actual: '+__string.match(/\d{1}/g).length); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +for(var mi=0; mi<__matches.length; mi++) { + if (__string.match(/\d{1}/g)[mi]!==__matches[mi]) { + $ERROR('#2.'+mi+': __matches=["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]; __string = "123456abcde7890"; __string.match(/\\d{1}/g)['+mi+']===__matches['+mi+']. Actual: '+__string.match(/\d{1}/g)[mi]); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A2_T4.js new file mode 100644 index 000000000..ef622ced2 --- /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.10_String.prototype.match/S15.5.4.10_A2_T4.js @@ -0,0 +1,31 @@ +// 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.10_A2_T4; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /\d{2}/g; +*/ + +var __matches=["12", "34", "56", "78", "90"]; + +var __string = "123456abcde7890"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(/\d{2}/g).length!== 5) { + $ERROR('#1: __string = "123456abcde7890"; __string.match(/\\d{2}/g).length=== 5. Actual: '+__string.match(/\d{2}/g).length); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +for(var mi=0; mi<__matches.length; mi++) { + if (__string.match(/\d{2}/g)[mi]!==__matches[mi]) { + $ERROR('#2.'+mi+': __matches=["12", "34", "56", "78", "90"]; __string = "123456abcde7890"; __string.match(/\\d{2}/g)['+mi+']===__matches['+mi+']. Actual: '+__string.match(/\d{2}/g)[mi]); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A2_T5.js new file mode 100644 index 000000000..20ffc7c1a --- /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.10_String.prototype.match/S15.5.4.10_A2_T5.js @@ -0,0 +1,31 @@ +// 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.10_A2_T5; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /\D{2}/g; +*/ + +var __matches=["ab", "cd"]; + +var __string = "123456abcde7890"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(/\D{2}/g).length!== 2) { + $ERROR('#1: __string = "123456abcde7890"; __string.match(/\\D{2}/g).length=== 2. Actual: '+__string.match(/\D{2}/g).length); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +for(var mi=0; mi<__matches.length; mi++) { + if (__string.match(/\D{2}/g)[mi]!==__matches[mi]) { + $ERROR('#2.'+mi+': __matches=["ab", "cd"]; __string = "123456abcde7890"; __string.match(/\\D{2}/g)['+mi+']===__matches['+mi+']. Actual: '+__string.match(/\D{2}/g)[mi]); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A2_T6.js new file mode 100644 index 000000000..b309ab196 --- /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.10_String.prototype.match/S15.5.4.10_A2_T6.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: S15.5.4.10_A2_T6; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /([\d]{5})([-\ ]?[\d]{4})?$/. Last match is void 0; +*/ + +var __string = "Boston, Mass. 02134"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/)[0]!== "02134") { + $ERROR('#1: __string = "Boston, Mass. 02134"; __string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/)[0]=== "02134". Actual: '+__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/)[0]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/)[1]!== "02134") { + $ERROR('#2: __string = "Boston, Mass. 02134"; __string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/)[1]=== "02134". Actual: '+__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/)[1]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/)[2]!== void 0) { + $ERROR('#3: __string = "Boston, Mass. 02134"; __string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/)[2]=== void 0. Actual: '+__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/)[2]); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/).length !==3) { + $ERROR('#4: __string = "Boston, Mass. 02134"; __string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/).length ===3. Actual: '+__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/).length ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#5 +if (__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/).index !==14) { + $ERROR('#5: __string = "Boston, Mass. 02134"; __string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/).index ===14. Actual: '+__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/).index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#6 +if (__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/).input !==__string) { + $ERROR('#6: __string = "Boston, Mass. 02134"; __string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/).input ===__string. Actual: '+__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/).input ); +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A2_T7.js new file mode 100644 index 000000000..22034f009 --- /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.10_String.prototype.match/S15.5.4.10_A2_T7.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.10_A2_T7; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /([\d]{5})([-\ ]?[\d]{4})?$/g; +*/ + +var __matches=["02134"]; + +var __string = "Boston, Mass. 02134"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/g).length!== 1) { + $ERROR('#1: __string = "Boston, Mass. 02134"; __string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/g).length=== 1. Actual: '+__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/g).length); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/g)[0]!==__matches[0]) { + $ERROR('#2: __matches=["02134"]; __string = "Boston, Mass. 02134"; __string.match(/([\\d]{5})([-\\ ]?[\\d]{4})?$/g)[0]===__matches[0]. Actual: '+__string.match(/([\d]{5})([-\ ]?[\d]{4})?$/g)[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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A2_T8.js new file mode 100644 index 000000000..28d2b320b --- /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.10_String.prototype.match/S15.5.4.10_A2_T8.js @@ -0,0 +1,43 @@ +// 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.10_A2_T8; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /([\d]{5})([-\ ]?[\d]{4})?$/. Last match is undefined. +* And regular expression object have property lastIndex = 0; +*/ + +var __matches=["02134", "02134", undefined]; + +var __re = /([\d]{5})([-\ ]?[\d]{4})?$/; +__re.lastIndex = 0; + +var __string = "Boston, MA 02134"; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(__re).length!== 3) { + $ERROR('#1: __string = "Boston, MA 02134"; __re = /([\d]{5})([-\ ]?[\d]{4})?$/; __string.match(__re).length=== 3. Actual: '+__string.match(__re).length); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__string.match(__re).index !==__string.lastIndexOf("0")) { + $ERROR('#2: __string = "Boston, MA 02134"; __re = /([\d]{5})([-\ ]?[\d]{4})?$/; __re.lastIndex = 0; __string.match(__re).index ===__string.lastIndexOf("0"). Actual: '+__string.match(__re).index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for(var mi=0; mi<__matches.length; mi++) { + if (__string.match(__re)[mi]!==__matches[mi]) { + $ERROR('#3.'+mi+': __string = "Boston, MA 02134"; __re = /([\d]{5})([-\ ]?[\d]{4})?$/; __matches=["02134", "02134", undefined]; __string.match(__re)['+mi+']===__matches['+mi+']. Actual: '+__string.match(__re)[mi]); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A2_T9.js new file mode 100644 index 000000000..960d0d27e --- /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.10_String.prototype.match/S15.5.4.10_A2_T9.js @@ -0,0 +1,44 @@ +// 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.10_A2_T9; +* @section: 15.5.4.10, 15.10.6.2; +* @assertion: match returns array as specified in 15.10.6.2; +* @description: Regular expression is /([\d]{5})([-\ ]?[\d]{4})?$/. Last match is undefined. +* And regular expression object have property lastIndex = tested_string.length; +*/ + +var __string = "Boston, MA 02134"; + +var __matches=["02134", "02134", undefined]; + +var __re = /([\d]{5})([-\ ]?[\d]{4})?$/; + +__re.lastIndex = __string.length; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (__string.match(__re).length!== 3) { + $ERROR('#1: __string = "Boston, MA 02134"; __re = /([\d]{5})([-\ ]?[\d]{4})?$/; __string.match(__re).length=== 3. Actual: '+__string.match(__re).length); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__string.match(__re).index !==__string.lastIndexOf("0")) { + $ERROR('#2: __string = "Boston, MA 02134"; __re = /([\d]{5})([-\ ]?[\d]{4})?$/; __re.lastIndex = __string.length; __string.match(__re).index ===__string.lastIndexOf("0"). Actual: '+__string.match(__re).index ); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +for(var mi=0; mi<__matches.length; mi++) { + if (__string.match(__re)[mi]!==__matches[mi]) { + $ERROR('#3.'+mi+': __string = "Boston, MA 02134"; __re = /([\d]{5})([-\ ]?[\d]{4})?$/; __matches=["02134", "02134", undefined]; __string.match(__re)['+mi+']===__matches['+mi+']. Actual: '+__string.match(__re)[mi]); + } +} +// +////////////////////////////////////////////////////////////////////////////// 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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A6.js new file mode 100644 index 000000000..20a410171 --- /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.10_String.prototype.match/S15.5.4.10_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.10_A6; +* @section: 15.5.4.10, 13.2; +* @assertion: String.prototype.match has not prototype property; +* @description: Checking String.prototype.match.prototype; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (String.prototype.match.prototype !== undefined) { + $ERROR('#1: String.prototype.match.prototype === undefined. Actual: '+String.prototype.match.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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A7.js new file mode 100644 index 000000000..14ffcecfd --- /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.10_String.prototype.match/S15.5.4.10_A7.js @@ -0,0 +1,16 @@ +// 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.10_A7; +* @section: 15.5.4.10, 13.2; +* @assertion: String.prototype.match can't be used as constructor; +* @description: Checking if creating "String.prototype.match object" fails; +*/ + +var __FACTORY = String.prototype.match; + +try { + var __instance = new __FACTORY; + $FAIL('#1: __FACTORY = String.prototype.match; __FACTORY = String.prototype.match; __instance = new __FACTORY lead to throwing exception'); +} catch (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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A8.js new file mode 100644 index 000000000..955a0f61b --- /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.10_String.prototype.match/S15.5.4.10_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.10_A8; +* @section: 15.5.4.10; +* @assertion: The String.prototype.match.length property has the attribute DontEnum; +* @description: Checking if enumerating the String.prototype.match.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.match.hasOwnProperty('length'))) { + $FAIL('#0: String.prototype.match.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.match.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////// +// CHECK#1 +if (String.prototype.match.propertyIsEnumerable('length')) { + $ERROR('#1: String.prototype.match.propertyIsEnumerable(\'length\') return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +// CHECK#2 +var count=0; + +for (p in String.prototype.match){ + if (p==="length") count++; +} + +if (count !== 0) { + $ERROR('#2: count=0; for (p in String.prototype.match){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.10_String.prototype.match/S15.5.4.10_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.10_String.prototype.match/S15.5.4.10_A9.js new file mode 100644 index 000000000..5e5ebb1fe --- /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.10_String.prototype.match/S15.5.4.10_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.10_A9; +* @section: 15.5.4.10; +* @assertion: The String.prototype.match.length property has the attribute DontDelete; +* @description: Checking if deleting the String.prototype.match.length property fails; +*/ + +////////////////////////////////////////////////////////////////////////////// +//CHECK#0 +if (!(String.prototype.match.hasOwnProperty('length'))) { + $FAIL('#0: String.prototype.match.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.match.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (delete String.prototype.match.length) { + $ERROR('#1: delete String.prototype.match.length return false'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (!(String.prototype.match.hasOwnProperty('length'))) { + $FAIL('#2: delete String.prototype.match.length; String.prototype.match.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.match.hasOwnProperty('length')); +} +// +////////////////////////////////////////////////////////////////////////////// |