diff options
Diffstat (limited to 'external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat')
39 files changed, 1402 insertions, 0 deletions
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T1.js new file mode 100644 index 000000000..25e593b6e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_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.1.2.3_A1_T1; + * @section: 15.1.2.3, 9.8; + * @assertion: Operator use ToString; + * @description: Checking for boolean primitive; +*/ + +//CHECK#1 +if (!(isNaN(parseFloat(true)) && isNaN(parseFloat("NaN")))) { + $ERROR('#1: parseFloat(true) === Not-a-Number; parseFloat("NaN") === Not-a-Number. Actual: ' + (parseFloat("NaN"))); +} + +//CHECK#2 +if (String(parseFloat(false)) !== "NaN") { + $ERROR('#2: String(parseFloat(false)) === "NaN". Actual: ' + (String(parseFloat(false)))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T2.js new file mode 100644 index 000000000..a0f81e2f7 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T2.js @@ -0,0 +1,38 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A1_T2; + * @section: 15.1.2.3, 9.8; + * @assertion: Operator use ToString; + * @description: Checking for number primitive; +*/ + +//CHECK#1 +if (parseFloat(-1.1) !== parseFloat("-1.1")) { + $ERROR('#1: parseFloat(-1.1) === parseFloat("-1.1"). Actual: ' + (parseFloat(-1.1))); +} + +//CHECK#2 +if (parseFloat(Infinity) !== parseFloat("Infinity")) { + $ERROR('#2: parseFloat(Infinity) === parseFloat("Infinity"). Actual: ' + (parseFloat(Infinity))); +} + +//CHECK#3 +if (String(parseFloat(NaN)) !== "NaN") { + $ERROR('#3: String(parseFloat(NaN)) === "NaN". Actual: ' + (String(parseFloat(NaN)))); +} + +//CHECK#4 +if (parseFloat(.01e+2) !== parseFloat(".01e+2")) { + $ERROR('#4: parseFloat(.01e+2) === parseFloat(".01e+2"). Actual: ' + (parseFloat(.01e+2))); +} + +//CHECK#5 +if (parseFloat(-0) !== 0) { + $ERROR('#5: parseFloat(-0) === 0. Actual: ' + (parseFloat(-0))); +} else { + if (1 / parseFloat(-0) !== Number.POSITIVE_INFINITY) { + $ERROR('#5: parseFloat(-0) === +0. Actual: ' + (parseFloat(-0))); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T3.js new file mode 100644 index 000000000..ea793257f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T3.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.1.2.3_A1_T3; + * @section: 15.1.2.3, 9.8; + * @assertion: Operator use ToString; + * @description: Checking for undefined and null; +*/ + +//CHECK#1 +if (!(isNaN(parseFloat(undefined)) && isNaN(parseFloat("NaN")))) { + $ERROR('#1: parseFloat(undefined) === Not-a-Number; parseFloat("NaN") === Not-a-Number. Actual: ' + (parseFloat("NaN"))); +} + +//CHECK#2 +if (!(isNaN(parseFloat(null)) && isNaN(parseFloat("NaN")))) { + $ERROR('#2: parseFloat(null) === Not-a-Number; parseFloat("NaN") === Not-a-Number. Actual: ' + (parseFloat("NaN"))); +} + + +//CHECK#3 +if (String(parseFloat(undefined)) !== "NaN") { + $ERROR('#3: String(parseFloat(undefined)) === "NaN". Actual: ' + (String(parseFloat(undefined)))); +} + +//CHECK#4 +if (String(parseFloat(null)) !== "NaN") { + $ERROR('#4: String(parseFloat(null)) === "NaN". Actual: ' + (String(parseFloat(null)))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T4.js new file mode 100644 index 000000000..033b76ad8 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_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.1.2.3_A1_T4; + * @section: 15.1.2.3, 9.8; + * @assertion: Operator use ToString; + * @description: Checking for Boolean object; +*/ + +//CHECK#1 +if (!(isNaN(parseFloat(new Boolean(true))) && isNaN(parseFloat("NaN")))) { + $ERROR('#1: parseFloat(new Boolean(true)) === Not-a-Number; parseFloat("NaN") === Not-a-Number. Actual: ' + (parseFloat("NaN"))); +} + +//CHECK#2 +if (String(parseFloat(new Boolean(false))) !== "NaN") { + $ERROR('#2: String(parseFloat(new Boolean(false))) === "NaN". Actual: ' + (String(parseFloat(new Boolean(false))))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T5.js new file mode 100644 index 000000000..8604f1a43 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T5.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.1.2.3_A1_T5; + * @section: 15.1.2.3, 9.8; + * @assertion: Operator use ToString; + * @description: Checking for Number object; +*/ + +//CHECK#1 +if (parseFloat(new Number(-1.1)) !== parseFloat("-1.1")) { + $ERROR('#1: parseFloat(new Number(-1.1)) === parseFloat("-1.1"). Actual: ' + (parseFloat(new Number(-1.1)))); +} + +//CHECK#2 +if (parseFloat(new Number(Infinity)) !== parseFloat("Infinity")) { + $ERROR('#2: parseFloat(new Number(Infinity)) === parseFloat("Infinity"). Actual: ' + (parseFloat(new Number(Infinity)))); +} + +//CHECK#3 +if (String(parseFloat(new Number(NaN))) !== "NaN") { + $ERROR('#3: String(parseFloat(new Number(NaN))) === "NaN". Actual: ' + (String(parseFloat(new Number(NaN))))); +} + +//CHECK#4 +if (parseFloat(new Number(.01e+2)) !== parseFloat(".01e+2")) { + $ERROR('#4: parseFloat(new Number(.01e+2)) === parseFloat(".01e+2"). Actual: ' + (parseFloat(new Number(.01e+2)))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T6.js new file mode 100644 index 000000000..dfc73b198 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T6.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.1.2.3_A1_T6; + * @section: 15.1.2.3, 9.8; + * @assertion: Operator use ToString; + * @description: Checking for String object; +*/ + +//CHECK#1 +if (parseFloat(new String("-1.1")) !== parseFloat("-1.1")) { + $ERROR('#1: parseFloat(new String("-1.1")) === parseFloat("-1.1"). Actual: ' + (parseFloat(new String("-1.1")))); +} + +//CHECK#2 +if (parseFloat(new String("Infinity")) !== parseFloat("Infinity")) { + $ERROR('#2: parseFloat(new String("Infinity")) === parseFloat("Infinity"). Actual: ' + (parseFloat(new String("Infinity")))); +} + +//CHECK#3 +if (String(parseFloat(new String("NaN"))) !== "NaN") { + $ERROR('#3: String(parseFloat(new String("NaN"))) === "NaN". Actual: ' + (String(parseFloat(new String("NaN"))))); +} + +//CHECK#4 +if (parseFloat(new String(".01e+2")) !== parseFloat(".01e+2")) { + $ERROR('#4: parseFloat(new String(".01e+2")) === parseFloat(".01e+2"). Actual: ' + (parseFloat(new String(".01e+2")))); +} + +//CHECK#5 +if (String(parseFloat(new String("false"))) !== "NaN") { + $ERROR('#5: String(parseFloat(new String("false"))) === "NaN". Actual: ' + (String(parseFloat(new String("false"))))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T7.js new file mode 100644 index 000000000..2eab8eccb --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A1_T7.js @@ -0,0 +1,78 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A1_T7; + * @section: 15.1.2.3, 9.8, 8.6.2.6; + * @assertion: Operator use ToString; + * @description: If Type(value) is Object, evaluate ToPrimitive(value, String); +*/ + +//CHECK#1 +var object = {valueOf: function() {return 1}}; +if (isNaN(parseFloat(object)) !== true) { + $ERROR('#1: var object = {valueOf: function() {return 1}}; parseFloat(object) === Not-a-Number. Actual: ' + (parseFloat(object))); +} + +//CHECK#2 +var object = {valueOf: function() {return 1}, toString: function() {return 0}}; +if (parseFloat(object) !== 0) { + $ERROR('#2: var object = {valueOf: function() {return 1}, toString: function() {return 0}}; parseFloat(object) === 0. Actual: ' + (parseFloat(object))); +} + +//CHECK#3 +var object = {valueOf: function() {return 1}, toString: function() {return {}}}; +if (parseFloat(object) !== 1) { + $ERROR('#3: var object = {valueOf: function() {return 1}, toString: function() {return {}}}; parseFloat(object) === 1. Actual: ' + (parseFloat(object))); +} + +//CHECK#4 +try { + var object = {valueOf: function() {throw "error"}, toString: function() {return 1}}; + if (parseFloat(object) !== 1) { + $ERROR('#4.1: var object = {valueOf: function() {throw "error"}, toString: function() {return 1}}; parseFloat(object) === 1. Actual: ' + (parseFloat(object))); + } +} +catch (e) { + if (e === "error") { + $ERROR('#4.2: var object = {valueOf: function() {throw "error"}, toString: function() {return 1}}; parseFloat(object) not throw "error"'); + } else { + $ERROR('#4.3: var object = {valueOf: function() {throw "error"}, toString: function() {return 1}}; parseFloat(object) not throw Error. Actual: ' + (e)); + } +} + +//CHECK#5 +var object = {toString: function() {return 1}}; +if (parseFloat(object) !== 1) { + $ERROR('#5: var object = {toString: function() {return 1}}; parseFloat(object) === 1. Actual: ' + (parseFloat(object))); +} + +//CHECK#6 +var object = {valueOf: function() {return {}}, toString: function() {return 1}} +if (parseFloat(object) !== 1) { + $ERROR('#6: var object = {valueOf: function() {return {}}, toString: function() {return 1}}; parseFloat(object) === 1. Actual: ' + (parseFloat(object))); +} + +//CHECK#7 +try { + var object = {valueOf: function() {return 1}, toString: function() {throw "error"}}; + parseFloat(object); + $ERROR('#7.1: var object = {valueOf: function() {return 1}, toString: function() {throw "error"}}; parseFloat(object) throw "error". Actual: ' + (parseFloat(object))); +} +catch (e) { + if (e !== "error") { + $ERROR('#7.2: var object = {valueOf: function() {return 1}, toString: function() {throw "error"}}; parseFloat(object) throw "error". Actual: ' + (e)); + } +} + +//CHECK#8 +try { + var object = {valueOf: function() {return {}}, toString: function() {return {}}}; + parseFloat(object); + $ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; parseFloat(object) throw TypeError. Actual: ' + (parseFloat(object))); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; parseFloat(object) throw TypeError. Actual: ' + (e)); + } +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T1.js new file mode 100644 index 000000000..a259bdd33 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T1.js @@ -0,0 +1,39 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A2_T1; + * @section: 15.1.2.3; + * @assertion: Operator remove leading StrWhiteSpaceChar; + * @description: StrWhiteSpaceChar :: TAB (U+0009); +*/ + +//CHECK#1 +if (parseFloat("\u00091.1") !== parseFloat("1.1")) { + $ERROR('#1: parseFloat("\\u00091.1") === parseFloat("1.1"). Actual: ' + (parseFloat("\u00091.1"))); +} + +//CHECK#2 +if (parseFloat("\u0009\u0009-1.1") !== parseFloat("-1.1")) { + $ERROR('#2: parseFloat("\\u0009\\u0009-1.1") === parseFloat("-1.1"). Actual: ' + (parseFloat("\u0009\u0009-1.1"))); +} + +//CHECK#3 +if (parseFloat(" 1.1") !== parseFloat("1.1")) { + $ERROR('#3: parseFloat(" 1.1") === parseFloat("1.1"). Actual: ' + (parseFloat(" 1.1"))); +} + +//CHECK#4 +if (parseFloat(" 1.1") !== parseFloat("1.1")) { + $ERROR('#4: parseFloat(" 1.1") === parseFloat("1.1"). Actual: ' + (parseFloat(" 1.1"))); +} + +//CHECK#5 +if (parseFloat(" \u0009 \u0009-1.1") !== parseFloat("-1.1")) { + $ERROR('#5: parseFloat(" \\u0009 \\u0009-1.1") === parseFloat("-1.1"). Actual: ' + (parseFloat(" \u0009 \u0009-1.1"))); +} + +//CHECK#6 +if (isNaN(parseFloat("\u0009")) !== true) { + $ERROR('#6: parseFloat("\\u0009") === Not-a-Number. Actual: ' + (parseFloat("\u0009"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T10.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T10.js new file mode 100644 index 000000000..9fa2cb5c6 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T10.js @@ -0,0 +1,38 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A2_T10; + * @section: 15.1.2.3; + * @assertion: Operator remove leading StrWhiteSpaceChar; + * @description: StrWhiteSpaceChar :: USP; +*/ + +//CHECK# +var count = 0; +var errorCount = 0; +var uspU = ["\u1680", "\u180E", "\u2000", "\u2001", "\u2002", "\u2003", "\u2004", "\u2005", "\u2006", "\u2007", "\u2008", "\u2009", "\u200A", "\u202F", "\u205F", "\u3000"]; +var uspS = ["1680", "180E", "2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009", "200A", "202F", "205F", "3000"]; +for (var index = 0; index < uspU.length; index++) { + var result = true; + if (parseFloat(uspU[index] + "1.1") !== parseFloat("1.1")) { + $ERROR('#1.' + uspS[index] + ' '); + result = false; + } + if (parseFloat(uspU[index] + uspU[index] + uspU[index] + "1.1") !== parseFloat("1.1")) { + $ERROR('#2.' + uspS[index] + ' '); + result = false; + } + if (isNaN(parseFloat(uspU[index])) !== true) { + $ERROR('#3.' + uspS[index] + ' '); + result = false; + } + if (result !== true) { + errorCount++; + } + count++; +} + +if (errorCount > 0) { + $ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T2.js new file mode 100644 index 000000000..4c942ea1f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T2.js @@ -0,0 +1,39 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A2_T2; + * @section: 15.1.2.3; + * @assertion: Operator remove leading StrWhiteSpaceChar; + * @description: StrWhiteSpaceChar :: SP (U+0020); +*/ + +//CHECK#1 +if (parseFloat("\u00201.1") !== parseFloat("1.1")) { + $ERROR('#1: parseFloat("\\u00201.1") === parseFloat("1.1"). Actual: ' + (parseFloat("\u00201.1"))); +} + +//CHECK#2 +if (parseFloat("\u0020\u0020-1.1") !== parseFloat("-1.1")) { + $ERROR('#2: parseFloat("\\u0020\\u0020-1.1") === parseFloat("-1.1"). Actual: ' + (parseFloat("\u0020\u0020-1.1"))); +} + +//CHECK#3 +if (parseFloat(" 1.1") !== parseFloat("1.1")) { + $ERROR('#3: parseFloat(" 1.1") === parseFloat("1.1"). Actual: ' + (parseFloat(" 1.1"))); +} + +//CHECK#4 +if (parseFloat(" 1.1") !== parseFloat("1.1")) { + $ERROR('#4: parseFloat(" 1.1") === parseFloat("1.1"). Actual: ' + (parseFloat(" 1.1"))); +} + +//CHECK#5 +if (parseFloat(" \u0020 \u0020-1.1") !== parseFloat("-1.1")) { + $ERROR('#5: parseFloat(" \\u0020 \\u0020-1.1") === parseFloat("-1.1"). Actual: ' + (parseFloat(" \u0020 \u0020-1.1"))); +} + +//CHECK#6 +if (isNaN(parseFloat("\u0020")) !== true) { + $ERROR('#6: parseFloat("\\u0020") === Not-a-Number. Actual: ' + (parseFloat("\u0020"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T3.js new file mode 100644 index 000000000..13d1eb022 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T3.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.1.2.3_A2_T3; + * @section: 15.1.2.3; + * @assertion: Operator remove leading StrWhiteSpaceChar; + * @description: StrWhiteSpaceChar :: NBSB (U+00A0); +*/ + +//CHECK#1 +if (parseFloat("\u00A01.1") !== parseFloat("1.1")) { + $ERROR('#1: parseFloat("\\u00A01.1") === parseFloat("1.1"). Actual: ' + (parseFloat("\u00A01.1"))); +} + +//CHECK#2 +if (parseFloat("\u00A0\u00A0-1.1") !== parseFloat("-1.1")) { + $ERROR('#2: parseFloat("\\u00A0\\u00A0-1.1") === parseFloat("-1.1"). Actual: ' + (parseFloat("\u00A0\u00A0-1.1"))); +} + +//CHECK#3 +if (isNaN(parseFloat("\u00A0")) !== true) { + $ERROR('#3: parseFloat("\\u00A0") === Not-a-Number. Actual: ' + (parseFloat("\u00A0"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T4.js new file mode 100644 index 000000000..494a1947e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T4.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.1.2.3_A2_T4; + * @section: 15.1.2.3; + * @assertion: Operator remove leading StrWhiteSpaceChar; + * @description: StrWhiteSpaceChar :: FF (U+000C); +*/ + +//CHECK#1 +if (parseFloat("\u000C1.1") !== parseFloat("1.1")) { + $ERROR('#1: parseFloat("\\u000C1.1") === parseFloat("1.1"). Actual: ' + (parseFloat("\u000C1.1"))); +} + +//CHECK#2 +if (parseFloat("\u000C\u000C-1.1") !== parseFloat("-1.1")) { + $ERROR('#2: parseFloat("\\u000C\\u000C-1.1") === parseFloat("-1.1"). Actual: ' + (parseFloat("\u000C\u000C-1.1"))); +} + +//CHECK#3 +if (isNaN(parseFloat("\u000C")) !== true) { + $ERROR('#3: parseFloat("\\u000C") === Not-a-Number. Actual: ' + (parseFloat("\u000C"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T5.js new file mode 100644 index 000000000..6b28ea1d1 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_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.1.2.3_A2_T5; + * @section: 15.1.2.3; + * @assertion: Operator remove leading StrWhiteSpaceChar; + * @description: StrWhiteSpaceChar :: VT (U+000B); +*/ + +//CHECK#1 +if (parseFloat("\u000B1.1") !== parseFloat("1.1")) { + $ERROR('#1: parseFloat("\\u000B1.1") === parseFloat("1.1"). Actual: ' + (parseFloat("\u000B1.1"))); +} + +//CHECK#2 +if (parseFloat("\u000B\u000B-1.1") !== parseFloat("-1.1")) { + $ERROR('#2: parseFloat("\\u000B\\u000B-1.1") === parseFloat("-1.1"). Actual: ' + (parseFloat("\u000B\u000B-1.1"))); +} + +//CHECK#3 +if (isNaN(parseFloat("\u000B")) !== true) { + $ERROR('#3: parseFloat("\\u000B") === Not-a-Number. Actual: ' + (parseFloat("\u000B"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T6.js new file mode 100644 index 000000000..6c0aee42f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T6.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.1.2.3_A2_T6; + * @section: 15.1.2.3; + * @assertion: Operator remove leading StrWhiteSpaceChar; + * @description: StrWhiteSpaceChar :: CR (U+000D); +*/ + +//CHECK#1 +if (parseFloat("\u000D1.1") !== parseFloat("1.1")) { + $ERROR('#1: parseFloat("\\u000D1.1") === parseFloat("1.1"). Actual: ' + (parseFloat("\u000D1.1"))); +} + +//CHECK#2 +if (parseFloat("\u000D\u000D-1.1") !== parseFloat("-1.1")) { + $ERROR('#2: parseFloat("\\u000D\\u000D-1.1") === parseFloat("-1.1"). Actual: ' + (parseFloat("\u000D\u000D-1.1"))); +} + +//CHECK#3 +if (isNaN(parseFloat("\u000D")) !== true) { + $ERROR('#3: parseFloat("\\u000D") === Not-a-Number. Actual: ' + (parseFloat("\u000D"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T7.js new file mode 100644 index 000000000..30e3dcb24 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T7.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.1.2.3_A2_T7; + * @section: 15.1.2.3; + * @assertion: Operator remove leading StrWhiteSpaceChar; + * @description: StrWhiteSpaceChar :: LF (U+000A); +*/ + +//CHECK#1 +if (parseFloat("\u000A1.1") !== parseFloat("1.1")) { + $ERROR('#1: parseFloat("\\u000A1.1") === parseFloat("1.1"). Actual: ' + (parseFloat("\u000A1.1"))); +} + +//CHECK#2 +if (parseFloat("\u000A\u000A-1.1") !== parseFloat("-1.1")) { + $ERROR('#2: parseFloat("\\u000A\\u000A-1.1") === parseFloat("-1.1"). Actual: ' + (parseFloat("\u000A\u000A-1.1"))); +} + +//CHECK#3 +if (isNaN(parseFloat("\u000A")) !== true) { + $ERROR('#3: parseFloat("\\u000A") === Not-a-Number. Actual: ' + (parseFloat("\u000A"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T8.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T8.js new file mode 100644 index 000000000..648e19e2a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T8.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.1.2.3_A2_T8; + * @section: 15.1.2.3; + * @assertion: Operator remove leading StrWhiteSpaceChar; + * @description: StrWhiteSpaceChar :: LS (U+2028); +*/ + +//CHECK#1 +if (parseFloat("\u20281.1") !== parseFloat("1.1")) { + $ERROR('#1: parseFloat("\\u20281.1") === parseFloat("1.1"). Actual: ' + (parseFloat("\u20281.1"))); +} + +//CHECK#2 +if (parseFloat("\u2028\u2028-1.1") !== parseFloat("-1.1")) { + $ERROR('#2: parseFloat("\\u2028\\u2028-1.1") === parseFloat("-1.1"). Actual: ' + (parseFloat("\u2028\u2028-1.1"))); +} + +//CHECK#3 +if (isNaN(parseFloat("\u2028")) !== true) { + $ERROR('#3: parseFloat("\\u2028") === Not-a-Number. Actual: ' + (parseFloat("\u2028"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T9.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T9.js new file mode 100644 index 000000000..4802ad16b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A2_T9.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.1.2.3_A2_T9; + * @section: 15.1.2.3; + * @assertion: Operator remove leading StrWhiteSpaceChar; + * @description: StrWhiteSpaceChar :: PS (U+2029); +*/ + +//CHECK#1 +if (parseFloat("\u20291.1") !== parseFloat("1.1")) { + $ERROR('#1: parseFloat("\\u20291.1") === parseFloat("1.1"). Actual: ' + (parseFloat("\u20291.1"))); +} + +//CHECK#2 +if (parseFloat("\u2029\u2029-1.1") !== parseFloat("-1.1")) { + $ERROR('#2: parseFloat("\\u2029\\u2029-1.1") === parseFloat("-1.1"). Actual: ' + (parseFloat("\u2029\u2029-1.1"))); +} + +//CHECK#3 +if (isNaN(parseFloat("\u2029")) !== true) { + $ERROR('#3: parseFloat("\\u2029") === Not-a-Number. Actual: ' + (parseFloat("\u2029"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A3_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A3_T1.js new file mode 100644 index 000000000..5e7bcb81e --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A3_T1.js @@ -0,0 +1,45 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A3_T1; + * @section: 15.1.2.3, 9.3.1; + * @assertion: If neither Result(2) nor any prefix of Result(2) satisfies the syntax of a + * StrDecimalLiteral (see 9.3.1), return NaN; + * @description: parseFloat("some string") return NaN; +*/ + +//CHECK#1 +if (isNaN(parseFloat("str")) !== true) { + $ERROR('#1: parseFloat("str") === Not-a-Number. Actual: ' + (parseFloat("str"))); +} + +//CHECK#2 +if (isNaN(parseFloat("s1")) !== true) { + $ERROR('#2: parseFloat("s1") === Not-a-Number. Actual: ' + (parseFloat("s1"))); +} + +//CHECK#3 +if (isNaN(parseFloat("")) !== true) { + $ERROR('#3: parseFloat("") === Not-a-Number. Actual: ' + (parseFloat(""))); +} + +//CHECK#4 +if (String(parseFloat("str")) !== "NaN") { + $ERROR('#4: String(parseFloat("str")) === "NaN". Actual: ' + (String(parseFloat("str")))); +} + +//CHECK#5 +if (String(parseFloat("s1")) !== "NaN") { + $ERROR('#5: String(parseFloat("s1")) === "NaN". Actual: ' + (String(parseFloat("s1")))); +} + +//CHECK#6 +if (String(parseFloat("")) !== "NaN") { + $ERROR('#6: String(parseFloat("")) === "NaN". Actual: ' + (String(parseFloat("")))); +} + +//CHECK#7 +if (String(parseFloat("+")) !== "NaN") { + $ERROR('#7: String(parseFloat("+")) === "NaN". Actual: ' + (String(parseFloat("+")))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A3_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A3_T2.js new file mode 100644 index 000000000..8e3c91b23 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A3_T2.js @@ -0,0 +1,60 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A3_T2; + * @section: 15.1.2.3, 9.3.1; + * @assertion: If neither Result(2) nor any prefix of Result(2) satisfies the syntax of a + * StrDecimalLiteral (see 9.3.1), return NaN; + * @description: parseFloat("wrong number format with ExponentIndicator") return NaN; +*/ + +//CHECK#1 +if (isNaN(parseFloat("e1")) !== true) { + $ERROR('#1: parseFloat("e1") === Not-a-Number. Actual: ' + (parseFloat("e1"))); +} + +//CHECK#2 +if (isNaN(parseFloat("e-1")) !== true) { + $ERROR('#2: parseFloat("e-1") === Not-a-Number. Actual: ' + (parseFloat("e-1"))); +} + +//CHECK#3 +if (isNaN(parseFloat("E+1")) !== true) { + $ERROR('#3: parseFloat("E+1") === Not-a-Number. Actual: ' + (parseFloat("E+1"))); +} + +//CHECK#4 +if (isNaN(parseFloat("E0")) !== true) { + $ERROR('#4: parseFloat("E0") === Not-a-Number. Actual: ' + (parseFloat("E0"))); +} + +//CHECK#5 +if (String(parseFloat("e1")) !== "NaN") { + $ERROR('#5: String(parseFloat("e1")) === "NaN". Actual: ' + (String(parseFloat("e1")))); +} + +//CHECK#6 +if (String(parseFloat("e-1")) !== "NaN") { + $ERROR('#6: String(parseFloat("e-1")) === "NaN". Actual: ' + (String(parseFloat("e-1")))); +} + +//CHECK#7 +if (String(parseFloat("E+1")) !== "NaN") { + $ERROR('#73: String(parseFloat("E+1")) === "NaN". Actual: ' + (String(parseFloat("E+1")))); +} + +//CHECK#8 +if (String(parseFloat("E0")) !== "NaN") { + $ERROR('#8: String(parseFloat("E0")) === "NaN". Actual: ' + (String(parseFloat("E0")))); +} + +//CHECK#9 +if (isNaN(parseFloat("-.e-1")) !== true) { + $ERROR('#9: parseFloat("-.e-1") === Not-a-Number. Actual: ' + (parseFloat("-.e-1"))); +} + +//CHECK#10 +if (isNaN(parseFloat(".e1")) !== true) { + $ERROR('#10: parseFloat(".e1") === Not-a-Number. Actual: ' + (parseFloat(".e1"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A3_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A3_T3.js new file mode 100644 index 000000000..cfa374acf --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A3_T3.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.1.2.3_A3_T3; + * @section: 15.1.2.3, 9.3.1; + * @assertion: If neither Result(2) nor any prefix of Result(2) satisfies the syntax of a + * StrDecimalLiteral (see 9.3.1), return NaN; + * @description: parseFloat("wrong numbr format") return NaN; +*/ + +//CHECK#1 +if (isNaN(parseFloat(".x")) !== true) { + $ERROR('#1: parseFloat(".x") === Not-a-Number. Actual: ' + (parseFloat(".x"))); +} + +//CHECK#2 +if (isNaN(parseFloat("+x")) !== true) { + $ERROR('#2: parseFloat("+x") === Not-a-Number. Actual: ' + (parseFloat("+x"))); +} + +//CHECK#3 +if (isNaN(parseFloat("infinity")) !== true) { + $ERROR('#3: parseFloat("infinity") === Not-a-Number. Actual: ' + (parseFloat("infinity"))); +} + +//CHECK#4 +if (isNaN(parseFloat("A")) !== true) { + $ERROR('#4: parseFloat("A") === Not-a-Number. Actual: ' + (parseFloat("A"))); +} + +//CHECK#5 +if (String(parseFloat(".s")) !== "NaN") { + $ERROR('#5: String(parseFloat(".s")) === "NaN". Actual: ' + (String(parseFloat(".s")))); +} + +//CHECK#6 +if (String(parseFloat("+x")) !== "NaN") { + $ERROR('#6: String(parseFloat("+x")) === "NaN". Actual: ' + (String(parseFloat("+x")))); +} + +//CHECK#7 +if (String(parseFloat("infinity")) !== "NaN") { + $ERROR('#73: String(parseFloat("infinity")) === "NaN". Actual: ' + (String(parseFloat("infinity")))); +} + +//CHECK#8 +if (String(parseFloat("A")) !== "NaN") { + $ERROR('#8: String(parseFloat("A")) === "NaN". Actual: ' + (String(parseFloat("A")))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T1.js new file mode 100644 index 000000000..70b3f930c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T1.js @@ -0,0 +1,55 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A4_T1; + * @section: 15.1.2.3, 9.3.1; + * @assertion: Compute the longest prefix of Result(2), which might be Result(2) itself, + * which satisfies the syntax of a StrDecimalLiteral; + * @description: Some wrong number; +*/ + +//CHECK#1 +if (parseFloat("0x") !== 0) { + $ERROR('#1: parseFloat("0x") === 0. Actual: ' + (parseFloat("0x"))); +} + +//CHECK#2 +if (parseFloat("11x") !== 11) { + $ERROR('#2: parseFloat("11x") === 11. Actual: ' + (parseFloat("11x"))); +} + +//CHECK#3 +if (parseFloat("11s1") !== 11) { + $ERROR('#3: parseFloat("11s1") === 11. Actual: ' + (parseFloat("11s1"))); +} + +//CHECK#4 +if (parseFloat("11.s1") !== 11) { + $ERROR('#4: parseFloat("11.s1") === 11. Actual: ' + (parseFloat("11.s1"))); +} + +//CHECK#5 +if (parseFloat(".0s1") !== 0) { + $ERROR('#5: parseFloat(".0s1") === 0. Actual: ' + (parseFloat(".0s1"))); +} + +//CHECK#6 +if (parseFloat("1.s1") !== 1) { + $ERROR('#6: parseFloat("1.s1") === 1. Actual: ' + (parseFloat("1.s1"))); +} + +//CHECK#7 +if (parseFloat("1..1") !== 1) { + $ERROR('#7: parseFloat("1..1") === 1. Actual: ' + (parseFloat("1..1"))); +} + +//CHECK#8 +if (parseFloat("0.1.1") !== 0.1) { + $ERROR('#8: parseFloat("0.1.1") === 0.1. Actual: ' + (parseFloat("0.1.1"))); +} + +//CHECK#9 +if (parseFloat("0. 1") !== 0) { + $ERROR('#9: parseFloat("0. 1") === 0. Actual: ' + (parseFloat("0. 1"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T2.js new file mode 100644 index 000000000..612c8197c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T2.js @@ -0,0 +1,35 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A4_T2; + * @section: 15.1.2.3, 9.3.1; + * @assertion: Compute the longest prefix of Result(2), which might be Result(2) itself, + * which satisfies the syntax of a StrDecimalLiteral; + * @description: With ExponentIndicator; +*/ + +//CHECK#1 +if (parseFloat("1ex") !== 1) { + $ERROR('#1: parseFloat("1ex") === 1. Actual: ' + (parseFloat("1ex"))); +} + +//CHECK#2 +if (parseFloat("1e-x") !== 1) { + $ERROR('#2: parseFloat("1e-x") === 1. Actual: ' + (parseFloat("1e-x"))); +} + +//CHECK#3 +if (parseFloat("1e1x") !== 10) { + $ERROR('#3: parseFloat("1e1x") === 10. Actual: ' + (parseFloat("1e1x"))); +} + +//CHECK#4 +if (parseFloat("1e-1x") !== 0.1) { + $ERROR('#4: parseFloat("1e-1x") === 0.1. Actual: ' + (parseFloat("1e-1x"))); +} + +//CHECK#5 +if (parseFloat("0.1e-1x") !== 0.01) { + $ERROR('#5: parseFloat("0.1e-1x") === 0.01. Actual: ' + (parseFloat("0.1e-1x"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T3.js new file mode 100644 index 000000000..d24c6e6ad --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T3.js @@ -0,0 +1,90 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A4_T3; + * @section: 15.1.2.3, 9.3.1; + * @assertion: Compute the longest prefix of Result(2), which might be Result(2) itself, + * which satisfies the syntax of a StrDecimalLiteral; + * @description: StrDecimalLiteral not contain HexIntegerLiteral; +*/ + +//CHECK#0 +if (parseFloat("0x0") !== 0) { + $ERROR('#0: parseFloat("0x0") === 0. Actual: ' + (parseFloat("0x0"))); +} + +//CHECK#1 +if (parseFloat("0x1") !== 0) { + $ERROR('#1: parseFloat("0x1") === 0. Actual: ' + (parseFloat("0x1"))); +} + +//CHECK#2 +if (parseFloat("0x2") !== 0) { + $ERROR('#2: parseFloat("0x2") === 0. Actual: ' + (parseFloat("0x2"))); +} + +//CHECK#3 +if (parseFloat("0x3") !== 0) { + $ERROR('#3: parseFloat("0x3") === 0. Actual: ' + (parseFloat("0x3"))); +} + +//CHECK#4 +if (parseFloat("0x4") !== 0) { + $ERROR('#4: parseFloat("0x4") === 0. Actual: ' + (parseFloat("0x4"))); +} + +//CHECK#5 +if (parseFloat("0x5") !== 0) { + $ERROR('#5: parseFloat("0x5") === 0. Actual: ' + (parseFloat("0x5"))); +} + +//CHECK#6 +if (parseFloat("0x6") !== 0) { + $ERROR('#6: parseFloat("0x6") === 0. Actual: ' + (parseFloat("0x6"))); +} + +//CHECK#7 +if (parseFloat("0x7") !== 0) { + $ERROR('#7: parseFloat("0x7") === 0. Actual: ' + (parseFloat("0x7"))); +} + +//CHECK#8 +if (parseFloat("0x8") !== 0) { + $ERROR('#8: parseFloat("0x8") === 0. Actual: ' + (parseFloat("0x8"))); +} + +//CHECK#9 +if (parseFloat("0x9") !== 0) { + $ERROR('#9: parseFloat("0x9") === 0. Actual: ' + (parseFloat("0x9"))); +} + +//CHECK#A +if (parseFloat("0xA") !== 0) { + $ERROR('#A: parseFloat("0xA") === 0. Actual: ' + (parseFloat("0xA"))); +} + +//CHECK#B +if (parseFloat("0xB") !== 0) { + $ERROR('#B: parseFloat("0xB") === 0. Actual: ' + (parseFloat("0xB"))); +} + +//CHECK#C +if (parseFloat("0xC") !== 0) { + $ERROR('#C: parseFloat("0xC") === 0. Actual: ' + (parseFloat("0xC"))); +} + +//CHECK#D +if (parseFloat("0xD") !== 0) { + $ERROR('#D: parseFloat("0xD") === 0. Actual: ' + (parseFloat("0xD"))); +} + +//CHECK#E +if (parseFloat("0xE") !== 0) { + $ERROR('#E: parseFloat("0xE") === 0. Actual: ' + (parseFloat("0xE"))); +} + +//CHECK#F +if (parseFloat("0xF") !== 0) { + $ERROR('#F: parseFloat("0xF") === 0. Actual: ' + (parseFloat("0xF"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T4.js new file mode 100644 index 000000000..19b434f51 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T4.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.1.2.3_A4_T4; + * @section: 15.1.2.3, 9.3.1; + * @assertion: Compute the longest prefix of Result(2), which might be Result(2) itself, + * which satisfies the syntax of a StrDecimalLiteral; + * @description: "Infinity"+"some string"; +*/ + +//CHECK#1 +if (parseFloat("Infinity1") !== Number.POSITIVE_INFINITY) { + $ERROR('#1: parseFloat("Infinity1") === Number.POSITIVE_INFINITY. Actual: ' + (parseFloat("Infinity1"))); +} + +//CHECK#2 +if (parseFloat("Infinityx") !== Number.POSITIVE_INFINITY) { + $ERROR('#2: parseFloat("Infinityx") === Number.POSITIVE_INFINITY. Actual: ' + (parseFloat("Infinityx"))); +} + +//CHECK#3 +if (parseFloat("Infinity+1") !== Number.POSITIVE_INFINITY) { + $ERROR('#3: parseFloat("Infinity+1") === Number.POSITIVE_INFINITY. Actual: ' + (parseFloat("Infinity+1"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T5.js new file mode 100644 index 000000000..510df03a4 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T5.js @@ -0,0 +1,60 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A4_T5; + * @section: 15.1.2.3, 9.3.1; + * @assertion: Compute the longest prefix of Result(2), which might be Result(2) itself, + * which satisfies the syntax of a StrDecimalLiteral; + * @description: Checking DecimalDigits . DecimalDigits_opt ExponentPart_opt; +*/ + +//CHECK#1 +if (parseFloat("-11.string") !== -11) { + $ERROR('#1: parseFloat("-11.string") === -11. Actual: ' + (parseFloat("-11.string"))); +} + +//CHECK#2 +if (parseFloat("01.string") !== 1) { + $ERROR('#2: parseFloat("01.string") === 1. Actual: ' + (parseFloat("01.string"))); +} + +//CHECK#3 +if (parseFloat("+11.1string") !== 11.1) { + $ERROR('#3: parseFloat("+11.1string") === 11.1. Actual: ' + (parseFloat("+11.1string"))); +} + +//CHECK#4 +if (parseFloat("01.1string") !== 1.1) { + $ERROR('#4: parseFloat("01.1string") === 1.1. Actual: ' + (parseFloat("01.1string"))); +} + +//CHECK#5 +if (parseFloat("-11.e-1string") !== -1.1) { + $ERROR('#5: parseFloat("-11.e-1string") === -1.1. Actual: ' + (parseFloat("-11.e-1string"))); +} + +//CHECK#6 +if (parseFloat("01.e1string") !== 10) { + $ERROR('#6: parseFloat("01.e1string") === 10. Actual: ' + (parseFloat("01.e1string"))); +} + +//CHECK#7 +if (parseFloat("+11.22e-1string") !== 1.122) { + $ERROR('#7: parseFloat("+11.22e-1string") === 1.122. Actual: ' + (parseFloat("+11.22e-1string"))); +} + +//CHECK#8 +if (parseFloat("01.01e1string") !== 10.1) { + $ERROR('#8: parseFloat("01.01e1string") === 10.1. Actual: ' + (parseFloat("01.01e1string"))); +} + +//CHECK#9 +if (parseFloat("001.string") !== 1) { + $ERROR('#9: parseFloat("001.string") === 1. Actual: ' + (parseFloat("001.string"))); +} + +//CHECK#10 +if (parseFloat("010.string") !== 10) { + $ERROR('#10: parseFloat("010.string") === 10. Actual: ' + (parseFloat("010.string"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T6.js new file mode 100644 index 000000000..d707c8e0a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T6.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.1.2.3_A4_T6; + * @section: 15.1.2.3, 9.3.1; + * @assertion: Compute the longest prefix of Result(2), which might be Result(2) itself, + * which satisfies the syntax of a StrDecimalLiteral; + * @description: Checking . DecimalDigits ExponentPart_opt; +*/ + + +//CHECK#1 +if (parseFloat("+.1string") !== 0.1) { + $ERROR('#1: parseFloat("+.1string") === 0.1. Actual: ' + (parseFloat("+.1string"))); +} + +//CHECK#2 +if (parseFloat(".01string") !== 0.01) { + $ERROR('#2: parseFloat(".01string") === 0.01. Actual: ' + (parseFloat(".01string"))); +} + +//CHECK#3 +if (parseFloat("+.22e-1string") !== 0.022) { + $ERROR('#3: parseFloat("+.22e-1string") === 0.022. Actual: ' + (parseFloat("+.22e-1string"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T7.js new file mode 100644 index 000000000..bd2e9a62b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A4_T7.js @@ -0,0 +1,45 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A4_T7; + * @section: 15.1.2.3, 9.3.1; + * @assertion: Compute the longest prefix of Result(2), which might be Result(2) itself, + * which satisfies the syntax of a StrDecimalLiteral; + * @description: Checking DecimalDigits ExponentPart_opt; +*/ + +//CHECK#1 +if (parseFloat("-11string") !== -11) { + $ERROR('#1: parseFloat("-11string") === -11. Actual: ' + (parseFloat("-11string"))); +} + +//CHECK#2 +if (parseFloat("01string") !== 1) { + $ERROR('#2: parseFloat("01string") === 1. Actual: ' + (parseFloat("01string"))); +} + +//CHECK#3 +if (parseFloat("-11e-1string") !== -1.1) { + $ERROR('#3: parseFloat("-11e-1string") === -1.1. Actual: ' + (parseFloat("-11e-1string"))); +} + +//CHECK#4 +if (parseFloat("01e1string") !== 10) { + $ERROR('#4: parseFloat("01e1string") === 10. Actual: ' + (parseFloat("01e1string"))); +} + +//CHECK#5 +if (parseFloat("001string") !== 1) { + $ERROR('#5: parseFloat("001string") === 1. Actual: ' + (parseFloat("001string"))); +} + +//CHECK#6 +if (parseFloat("1e001string") !== 10) { + $ERROR('#6: parseFloat("1e001string") === 10. Actual: ' + (parseFloat("1e001string"))); +} + +//CHECK#7 +if (parseFloat("010string") !== 10) { + $ERROR('#7: parseFloat("010string") === 10. Actual: ' + (parseFloat("010string"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A5_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A5_T1.js new file mode 100644 index 000000000..3e526bbf3 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A5_T1.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.1.2.3_A5_T1; + * @section: 15.1.2.3, 9.3.1; + * @assertion: Return the number value for the MV of Result(4); + * @description: Checking Infinity; +*/ + +//CHECK#1 +if (parseFloat("Infinity") !== Number.POSITIVE_INFINITY) { + $ERROR('#1: parseFloat("Infinity") === Number.POSITIVE_INFINITY. Actual: ' + (parseFloat("Infinity"))); +} + +//CHECK#2 +if (parseFloat("+Infinity") !== Number.POSITIVE_INFINITY) { + $ERROR('#2: parseFloat("+Infinity") === Number.POSITIVE_INFINITY. Actual: ' + (parseFloat("+Infinity"))); +} + +//CHECK#3 +if (parseFloat("-Infinity") !== Number.NEGATIVE_INFINITY) { + $ERROR('#3: parseFloat("-Infinity") === Number.NEGATIVE_INFINITY. Actual: ' + (parseFloat("-Infinity"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A5_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A5_T2.js new file mode 100644 index 000000000..d7b94c3c8 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A5_T2.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.1.2.3_A5_T2; + * @section: 15.1.2.3, 9.3.1; + * @assertion: Return the number value for the MV of Result(4); + * @description: Checking DecimalDigits . DecimalDigits_opt ExponentPart_opt; +*/ + +//CHECK#1 +if (parseFloat("-11.") !== -11) { + $ERROR('#1: parseFloat("-11.") === -11. Actual: ' + (parseFloat("-11."))); +} + +//CHECK#2 +if (parseFloat("01.") !== 1) { + $ERROR('#2: parseFloat("01.") === 1. Actual: ' + (parseFloat("01."))); +} + +//CHECK#3 +if (parseFloat("+11.1") !== 11.1) { + $ERROR('#3: parseFloat("+11.1") === 11.1. Actual: ' + (parseFloat("+11.1"))); +} + +//CHECK#4 +if (parseFloat("01.1") !== 1.1) { + $ERROR('#4: parseFloat("01.1") === 1.1. Actual: ' + (parseFloat("01.1"))); +} + +//CHECK#5 +if (parseFloat("-11.e-1") !== -1.1) { + $ERROR('#5: parseFloat("-11.e-1") === -1.1. Actual: ' + (parseFloat("-11.e-1"))); +} + +//CHECK#6 +if (parseFloat("01.e1") !== 10) { + $ERROR('#6: parseFloat("01.e1") === 10. Actual: ' + (parseFloat("01.e1"))); +} + +//CHECK#7 +if (parseFloat("+11.22e-1") !== 1.122) { + $ERROR('#7: parseFloat("+11.22e-1") === 1.122. Actual: ' + (parseFloat("+11.22e-1"))); +} + +//CHECK#8 +if (parseFloat("01.01e1") !== 10.1) { + $ERROR('#8: parseFloat("01.01e1") === 10.1. Actual: ' + (parseFloat("01.01e1"))); +} + +//CHECK#9 +if (parseFloat("001.") !== 1) { + $ERROR('#9: parseFloat("001.") === 1. Actual: ' + (parseFloat("001."))); +} + +//CHECK#10 +if (parseFloat("010.") !== 10) { + $ERROR('#10: parseFloat("010.") === 10. Actual: ' + (parseFloat("010."))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A5_T3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A5_T3.js new file mode 100644 index 000000000..a6629049a --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A5_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.1.2.3_A5_T3; + * @section: 15.1.2.3, 9.3.1; + * @assertion: Return the number value for the MV of Result(4); + * @description: Checking . DecimalDigits ExponentPart_opt; +*/ + + +//CHECK#1 +if (parseFloat("+.1") !== 0.1) { + $ERROR('#1: parseFloat("+.1") === 0.1. Actual: ' + (parseFloat("+.1"))); +} + +//CHECK#2 +if (parseFloat(".01") !== 0.01) { + $ERROR('#2: parseFloat(".01") === 0.01. Actual: ' + (parseFloat(".01"))); +} + +//CHECK#3 +if (parseFloat("+.22e-1") !== 0.022) { + $ERROR('#3: parseFloat("+.22e-1") === 0.022. Actual: ' + (parseFloat("+.22e-1"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A5_T4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A5_T4.js new file mode 100644 index 000000000..b0fef7c1c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A5_T4.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.1.2.3_A5_T4; + * @section: 15.1.2.3, 9.3.1; + * @assertion: Return the number value for the MV of Result(4); + * @description: Checking DecimalDigits ExponentPart_opt; +*/ + +//CHECK#1 +if (parseFloat("-11") !== -11) { + $ERROR('#1: parseFloat("-11") === -11. Actual: ' + (parseFloat("-11"))); +} + +//CHECK#2 +if (parseFloat("01") !== 1) { + $ERROR('#2: parseFloat("01") === 1. Actual: ' + (parseFloat("01"))); +} + +//CHECK#3 +if (parseFloat("-11e-1") !== -1.1) { + $ERROR('#3: parseFloat("-11e-1") === -1.1. Actual: ' + (parseFloat("-11e-1"))); +} + +//CHECK#4 +if (parseFloat("01e1") !== 10) { + $ERROR('#4: parseFloat("01e1") === 10. Actual: ' + (parseFloat("01e1"))); +} + +//CHECK#5 +if (parseFloat("001") !== 1) { + $ERROR('#5: parseFloat("001") === 1. Actual: ' + (parseFloat("001"))); +} + +//CHECK#6 +if (parseFloat("1e001") !== 10) { + $ERROR('#6: parseFloat("1e001") === 10. Actual: ' + (parseFloat("1e001"))); +} + +//CHECK#7 +if (parseFloat("010") !== 10) { + $ERROR('#7: parseFloat("010") === 10. Actual: ' + (parseFloat("010"))); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A6.js new file mode 100644 index 000000000..361060a9c --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A6.js @@ -0,0 +1,80 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A6; + * @section: 15.1.2.3, 9.3.1; + * @assertion: parseFloat may interpret only a leading portion of the string as + * a number value; it ignores any characters that cannot be interpreted as part + * of the notation of an decimal literal, and no indication is given that any such + * characters were ignored. + * @description: Complex test without eval; +*/ + +//CHECK +var errorCount = 0; +var count = 0; +var indexP; +var indexO = 0; +for (var index = 0; index <= 65535; index++) { + if ((index < 0x0030) || (index > 0x0039)) { + var hex = decimalToHexString(index); + if (parseFloat("0.1e1" + String.fromCharCode(index)) !== 1) { + if (indexO === 0) { + indexO = index; + } else { + if ((index - indexP) !== 1) { + if ((indexP - indexO) !== 0) { + var hexP = decimalToHexString(indexP); + var hexO = decimalToHexString(indexO); + $ERROR('#' + hexO + '-' + hexP + ' '); + } + else { + var hexP = decimalToHexString(indexP); + $ERROR('#' + hexP + ' '); + } + indexO = index; + } + } + indexP = index; + errorCount++; + } + count++; + } +} + +if (errorCount > 0) { + if ((indexP - indexO) !== 0) { + var hexP = decimalToHexString(indexP); + var hexO = decimalToHexString(indexO); + $ERROR('#' + hexO + '-' + hexP + ' '); + } else { + var hexP = decimalToHexString(indexP); + $ERROR('#' + hexP + ' '); + } + $ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' '); +} + +function decimalToHexString(n) { + n = Number(n); + var h = ""; + for (var i = 3; i >= 0; i--) { + if (n >= Math.pow(16, i)) { + var t = Math.floor(n / Math.pow(16, i)); + n -= t * Math.pow(16, i); + if ( t >= 10 ) { + if ( t == 10 ) { h += "A"; } + if ( t == 11 ) { h += "B"; } + if ( t == 12 ) { h += "C"; } + if ( t == 13 ) { h += "D"; } + if ( t == 14 ) { h += "E"; } + if ( t == 15 ) { h += "F"; } + } else { + h += String(t); + } + } else { + h += "0"; + } + } + return h; +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.1.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.1.js new file mode 100644 index 000000000..4e896241f --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.1.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.1.2.3_A7.1; + * @section: 15.1.2.3, 15.2.4.7, 12.6.4; + * @assertion: The length property of parseFloat has the attribute DontEnum; + * @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (parseFloat.propertyIsEnumerable('length') !== false) { + $ERROR('#1: parseFloat.propertyIsEnumerable(\'length\') === false. Actual: ' + (parseFloat.propertyIsEnumerable('length'))); +} + +//CHECK#2 +var result = true; +for (var p in parseFloat){ + if (p === "length") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in parseFloat) { if (p === "length") result = false; } result === true;'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.2.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.2.js new file mode 100644 index 000000000..93482ebf5 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.2.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.1.2.3_A7.2; + * @section: 15.1.2.3, 15.2.4.5, 11.4.1; + * @assertion: The length property of parseFloat has the attribute DontDelete; + * @description: Checking use hasOwnProperty, delete; + * @strict_mode_negative +*/ + +//CHECK#1 +if (parseFloat.hasOwnProperty('length') !== true) { + $FAIL('#1: parseFloat.hasOwnProperty(\'length\') === true. Actual: ' + (parseFloat.hasOwnProperty('length'))); +} + +delete parseFloat.length; + +//CHECK#2 +if (parseFloat.hasOwnProperty('length') !== true) { + $ERROR('#2: delete parseFloat.length; parseFloat.hasOwnProperty(\'length\') === true. Actual: ' + (parseFloat.hasOwnProperty('length'))); +} + +//CHECK#3 +if (parseFloat.length === undefined) { + $ERROR('#3: delete parseFloat.length; parseFloat.length !== undefined'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.3.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.3.js new file mode 100644 index 000000000..b08cc1ca1 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.3.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.1.2.3_A7.3; + * @section: 15.1.2.3; + * @assertion: The length property of parseFloat has the attribute ReadOnly; + * @description: Checking if varying the length property fails; + * @strict_mode_negative +*/ + +//CHECK#1 +var x = parseFloat.length; +parseFloat.length = Infinity; +if (parseFloat.length !== x) { + $ERROR('#1: x = parseFloat.length; parseFloat.length = Infinity; parseFloat.length === x. Actual: ' + (parseFloat.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.4.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.4.js new file mode 100644 index 000000000..b955f7127 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.4.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @name: S15.1.2.3_A7.4; + * @section: 15.1.2.3; + * @assertion: The length property of parseFloat is 1; + * @description: parseFloat.length === 1; +*/ + +//CHECK#1 +if (parseFloat.length !== 1) { + $ERROR('#1: parseFloat.length === 1. Actual: ' + (parseFloat.length)); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.5.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.5.js new file mode 100644 index 000000000..d2f4fe176 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.5.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.1.2.3_A7.5; + * @section: 15.1.2.3, 15.2.4.7, 12.6.4; + * @assertion: The parseFloat property has the attribute DontEnum; + * @description: Checking use propertyIsEnumerable, for-in; +*/ + + +//CHECK#1 +if (this.propertyIsEnumerable('parseFloat') !== false) { + $ERROR('#1:this.propertyIsEnumerable(\'parseFloat\') === false. Actual: ' + (this.propertyIsEnumerable('parseFloat'))); +} + +//CHECK#2 +var result = true; +for (var p in this){ + if (p === "parseFloat") { + result = false; + } +} + +if (result !== true) { + $ERROR('#2: result = true; for (p in this) { if (p === "parseFloat") result = false; } result === true;'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.6.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.6.js new file mode 100644 index 000000000..192650f8b --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.6.js @@ -0,0 +1,14 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.1.2.3_A7.6; +* @section: 15.1.2.3; +* @assertion: The parseFloat property has not prototype property; +* @description: Checking parseFloat.prototype; +*/ + +//CHECK#1 +if (parseFloat.prototype !== undefined) { + $ERROR('#1: parseFloat.prototype === undefined. Actual: ' + (parseFloat.prototype)); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.7.js b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.7.js new file mode 100644 index 000000000..e3d902adc --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.2_Function_Properties_of_the_Global_Object/15.1.2.3_parseFloat/S15.1.2.3_A7.7.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S15.1.2.3_A7.7; +* @section: 15.1.2.3, 11.2.2; +* @assertion: The parseFloat property can't be used as constructor; +* @description: If property does not implement the internal [[Construct]] method, throw a TypeError exception; +*/ + +//CHECK#1 + +try { + new parseFloat(); + $ERROR('#1.1: new parseFloat() throw TypeError. Actual: ' + (new parseFloat())); +} catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1.2: new parseFloat() throw TypeError. Actual: ' + (e)); + } +} |