From 60a2879133a0b506d943e539295c08d9378f06e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Thu, 6 Aug 2015 18:24:22 +0200 Subject: [PATCH] Replace runTestCase with assert helpers [test/built-ins/Function] --- test/built-ins/Function/15.3.2.1-11-1.js | 6 ------ test/built-ins/Function/15.3.2.1-11-3.js | 5 ----- test/built-ins/Function/15.3.2.1-11-5.js | 6 ------ test/built-ins/Function/15.3.2.1-11-8-s.js | 7 ------- test/built-ins/Function/15.3.2.1-11-9-s.js | 5 ----- test/built-ins/Function/length/15.3.3.2-1.js | 14 ++++---------- .../Function/prototype/apply/15.3.4.3-1-s.js | 7 ++----- .../Function/prototype/apply/15.3.4.3-2-s.js | 7 ++----- .../Function/prototype/apply/15.3.4.3-3-s.js | 7 ++----- .../Function/prototype/bind/15.3.4.5-0-1.js | 8 +------- .../Function/prototype/bind/15.3.4.5-0-2.js | 8 +------- .../Function/prototype/bind/15.3.4.5-10-1.js | 8 ++------ .../Function/prototype/bind/15.3.4.5-13.b-1.js | 9 ++------- .../Function/prototype/bind/15.3.4.5-13.b-2.js | 9 ++------- .../Function/prototype/bind/15.3.4.5-13.b-3.js | 9 ++------- .../Function/prototype/bind/15.3.4.5-13.b-4.js | 9 ++------- .../Function/prototype/bind/15.3.4.5-13.b-5.js | 9 ++------- .../Function/prototype/bind/15.3.4.5-13.b-6.js | 9 ++------- .../Function/prototype/bind/15.3.4.5-15-1.js | 13 ++++--------- .../Function/prototype/bind/15.3.4.5-15-2.js | 15 +++++---------- .../Function/prototype/bind/15.3.4.5-15-4.js | 9 +++------ .../Function/prototype/bind/15.3.4.5-15-5.js | 9 +++------ .../Function/prototype/bind/15.3.4.5-16-1.js | 9 ++------- .../Function/prototype/bind/15.3.4.5-16-2.js | 8 ++------ .../Function/prototype/bind/15.3.4.5-2-3.js | 9 ++------- .../Function/prototype/bind/15.3.4.5-2-4.js | 9 ++------- .../Function/prototype/bind/15.3.4.5-2-5.js | 9 ++------- .../Function/prototype/bind/15.3.4.5-2-6.js | 9 ++------- .../Function/prototype/bind/15.3.4.5-2-8.js | 8 +++----- .../Function/prototype/bind/15.3.4.5-2-9.js | 9 ++------- .../Function/prototype/bind/15.3.4.5-3-1.js | 8 ++------ .../Function/prototype/bind/15.3.4.5-6-1.js | 8 ++------ .../Function/prototype/bind/15.3.4.5-6-12.js | 8 ++------ .../Function/prototype/bind/15.3.4.5-6-5.js | 8 ++------ .../Function/prototype/bind/15.3.4.5-6-9.js | 9 +++------ .../Function/prototype/bind/15.3.4.5-8-1.js | 9 ++------- .../Function/prototype/bind/15.3.4.5-8-2.js | 9 ++------- .../Function/prototype/bind/15.3.4.5-9-1.js | 9 ++------- .../Function/prototype/bind/15.3.4.5-9-2.js | 9 ++------- .../Function/prototype/bind/15.3.4.5.1-4-1.js | 6 +----- .../Function/prototype/bind/15.3.4.5.1-4-10.js | 6 +----- .../Function/prototype/bind/15.3.4.5.1-4-11.js | 6 +----- .../Function/prototype/bind/15.3.4.5.1-4-12.js | 6 +----- .../Function/prototype/bind/15.3.4.5.1-4-13.js | 6 +----- .../Function/prototype/bind/15.3.4.5.1-4-14.js | 6 +----- .../Function/prototype/bind/15.3.4.5.1-4-15.js | 6 +----- .../Function/prototype/bind/15.3.4.5.1-4-2.js | 6 +----- .../Function/prototype/bind/15.3.4.5.1-4-3.js | 6 +----- .../Function/prototype/bind/15.3.4.5.1-4-4.js | 6 +----- .../Function/prototype/bind/15.3.4.5.1-4-5.js | 6 +----- .../Function/prototype/bind/15.3.4.5.1-4-6.js | 6 +----- .../Function/prototype/bind/15.3.4.5.1-4-7.js | 6 +----- .../Function/prototype/bind/15.3.4.5.1-4-8.js | 6 +----- .../Function/prototype/bind/15.3.4.5.1-4-9.js | 6 +----- .../Function/prototype/bind/15.3.4.5.2-4-1.js | 10 ++++------ .../Function/prototype/bind/15.3.4.5.2-4-10.js | 6 +----- .../Function/prototype/bind/15.3.4.5.2-4-11.js | 6 +----- .../Function/prototype/bind/15.3.4.5.2-4-12.js | 6 +----- .../Function/prototype/bind/15.3.4.5.2-4-13.js | 6 +----- .../Function/prototype/bind/15.3.4.5.2-4-14.js | 6 +----- .../Function/prototype/bind/15.3.4.5.2-4-2.js | 10 ++++------ .../Function/prototype/bind/15.3.4.5.2-4-3.js | 6 +----- .../Function/prototype/bind/15.3.4.5.2-4-4.js | 6 +----- .../Function/prototype/bind/15.3.4.5.2-4-6.js | 6 +----- .../Function/prototype/bind/15.3.4.5.2-4-7.js | 6 +----- .../Function/prototype/bind/15.3.4.5.2-4-8.js | 6 +----- .../Function/prototype/bind/15.3.4.5.2-4-9.js | 6 +----- .../Function/prototype/call/15.3.4.4-1-s.js | 7 ++----- .../Function/prototype/call/15.3.4.4-2-s.js | 7 ++----- .../Function/prototype/call/15.3.4.4-3-s.js | 7 ++----- 70 files changed, 117 insertions(+), 415 deletions(-) diff --git a/test/built-ins/Function/15.3.2.1-11-1.js b/test/built-ins/Function/15.3.2.1-11-1.js index 189d8e438b..8caa5e5f77 100644 --- a/test/built-ins/Function/15.3.2.1-11-1.js +++ b/test/built-ins/Function/15.3.2.1-11-1.js @@ -6,12 +6,6 @@ es5id: 15.3.2.1-11-1 description: > Duplicate separate parameter name in Function constructor allowed if body not strict -includes: [runTestCase.js] ---*/ -function testcase() -{ Function('a','a','return;'); - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/Function/15.3.2.1-11-3.js b/test/built-ins/Function/15.3.2.1-11-3.js index 407029cfef..a1d3cf4316 100644 --- a/test/built-ins/Function/15.3.2.1-11-3.js +++ b/test/built-ins/Function/15.3.2.1-11-3.js @@ -6,11 +6,6 @@ es5id: 15.3.2.1-11-3 description: > Function constructor may have a formal parameter named 'eval' if body is not strict mode -includes: [runTestCase.js] ---*/ -function testcase() { Function('eval', 'return;'); - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/Function/15.3.2.1-11-5.js b/test/built-ins/Function/15.3.2.1-11-5.js index 6b9ad94913..90d4195724 100644 --- a/test/built-ins/Function/15.3.2.1-11-5.js +++ b/test/built-ins/Function/15.3.2.1-11-5.js @@ -6,12 +6,6 @@ es5id: 15.3.2.1-11-5 description: > Duplicate combined parameter name in Function constructor allowed if body is not strict -includes: [runTestCase.js] ---*/ -function testcase() -{ Function('a,a','return;'); - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/Function/15.3.2.1-11-8-s.js b/test/built-ins/Function/15.3.2.1-11-8-s.js index e8edf84654..2795b4ddf6 100644 --- a/test/built-ins/Function/15.3.2.1-11-8-s.js +++ b/test/built-ins/Function/15.3.2.1-11-8-s.js @@ -9,13 +9,6 @@ description: > which are separated by a unique parameter name and there is no explicit 'use strict' in the function constructor's body flags: [onlyStrict] -includes: [runTestCase.js] ---*/ -function testcase() { - var foo = new Function("baz", "qux", "baz", "return 0;"); - return true; - - } -runTestCase(testcase); diff --git a/test/built-ins/Function/15.3.2.1-11-9-s.js b/test/built-ins/Function/15.3.2.1-11-9-s.js index ae8eea9c89..fef8fdade3 100644 --- a/test/built-ins/Function/15.3.2.1-11-9-s.js +++ b/test/built-ins/Function/15.3.2.1-11-9-s.js @@ -8,11 +8,6 @@ description: > the Function constructor that has three identical parameters and there is no explicit 'use strict' in the function constructor's body -includes: [runTestCase.js] ---*/ -function testcase() { var foo = new Function("baz", "baz", "baz", "return 0;"); - return true; - } -runTestCase(testcase); diff --git a/test/built-ins/Function/length/15.3.3.2-1.js b/test/built-ins/Function/length/15.3.3.2-1.js index 4061a72eda..84c73661f6 100644 --- a/test/built-ins/Function/length/15.3.3.2-1.js +++ b/test/built-ins/Function/length/15.3.3.2-1.js @@ -4,17 +4,11 @@ /*--- es5id: 15.3.3.2-1 description: Function.length - data property with value 1 -includes: [runTestCase.js] ---*/ -function testcase() { - var desc = Object.getOwnPropertyDescriptor(Function,"length"); - if(desc.value === 1 && - desc.writable === false && - desc.enumerable === false && - desc.configurable === true) - return true; - } -runTestCase(testcase); +assert.sameValue(desc.value, 1, 'desc.value'); +assert.sameValue(desc.writable, false, 'desc.writable'); +assert.sameValue(desc.enumerable, false, 'desc.enumerable'); +assert.sameValue(desc.configurable, true, 'desc.configurable'); diff --git a/test/built-ins/Function/prototype/apply/15.3.4.3-1-s.js b/test/built-ins/Function/prototype/apply/15.3.4.3-1-s.js index f39e6a0f07..7ee954176d 100644 --- a/test/built-ins/Function/prototype/apply/15.3.4.3-1-s.js +++ b/test/built-ins/Function/prototype/apply/15.3.4.3-1-s.js @@ -8,13 +8,10 @@ description: > to wrapper objects when the function is called with an array of arguments flags: [onlyStrict] -includes: [runTestCase.js] ---*/ -function testcase() { function fun() { return (this instanceof String); } - return !fun.apply("", Array); - } -runTestCase(testcase); + +assert.sameValue(fun.apply("", Array), false, 'fun.apply("", Array)'); diff --git a/test/built-ins/Function/prototype/apply/15.3.4.3-2-s.js b/test/built-ins/Function/prototype/apply/15.3.4.3-2-s.js index ecd7d1af16..a717204bd4 100644 --- a/test/built-ins/Function/prototype/apply/15.3.4.3-2-s.js +++ b/test/built-ins/Function/prototype/apply/15.3.4.3-2-s.js @@ -8,13 +8,10 @@ description: > to wrapper objects when the function is called with an array of arguments flags: [onlyStrict] -includes: [runTestCase.js] ---*/ -function testcase() { function fun() { return (this instanceof Number); } - return !fun.apply(-12, Array); - } -runTestCase(testcase); + +assert.sameValue(fun.apply(-12, Array), false, 'fun.apply(-12, Array)'); diff --git a/test/built-ins/Function/prototype/apply/15.3.4.3-3-s.js b/test/built-ins/Function/prototype/apply/15.3.4.3-3-s.js index 3e401b0d99..762c5c5936 100644 --- a/test/built-ins/Function/prototype/apply/15.3.4.3-3-s.js +++ b/test/built-ins/Function/prototype/apply/15.3.4.3-3-s.js @@ -8,13 +8,10 @@ description: > to wrapper objects when the function is called with an array of arguments flags: [onlyStrict] -includes: [runTestCase.js] ---*/ -function testcase() { function fun() { return (this instanceof Boolean); } - return !fun.apply(false, Array); - } -runTestCase(testcase); + +assert.sameValue(fun.apply(false, Array), false, 'fun.apply(false, Array)'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-0-1.js b/test/built-ins/Function/prototype/bind/15.3.4.5-0-1.js index 64b37a4f47..721390cf70 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-0-1.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-0-1.js @@ -4,14 +4,8 @@ /*--- es5id: 15.3.4.5-0-1 description: Function.prototype.bind must exist as a function -includes: [runTestCase.js] ---*/ -function testcase() { var f = Function.prototype.bind; - if (typeof(f) === "function") { - return true; - } - } -runTestCase(testcase); +assert.sameValue(typeof(f), "function", 'typeof(f)'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-0-2.js b/test/built-ins/Function/prototype/bind/15.3.4.5-0-2.js index 15e642412e..7d119fba13 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-0-2.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-0-2.js @@ -4,12 +4,6 @@ /*--- es5id: 15.3.4.5-0-2 description: Function.prototype.bind must exist as a function taking 1 parameter -includes: [runTestCase.js] ---*/ -function testcase() { - if (Function.prototype.bind.length === 1) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Function.prototype.bind.length, 1, 'Function.prototype.bind.length'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-10-1.js b/test/built-ins/Function/prototype/bind/15.3.4.5-10-1.js index 2639cb7257..7486fce8d4 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-10-1.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-10-1.js @@ -6,14 +6,10 @@ es5id: 15.3.4.5-10-1 description: > Function.prototype.bind - internal property [[Class]] of 'F' is set as Function -includes: [runTestCase.js] ---*/ -function testcase() { - var foo = function () { }; var obj = foo.bind({}); - return Object.prototype.toString.call(obj) === "[object Function]"; - } -runTestCase(testcase); + +assert.sameValue(Object.prototype.toString.call(obj), "[object Function]", 'Object.prototype.toString.call(obj)'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-1.js b/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-1.js index 691d239f58..76a189908d 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-1.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-1.js @@ -4,16 +4,11 @@ /*--- es5id: 15.3.4.5-13.b-1 description: Function.prototype.bind, bound fn has a 'length' own property -includes: [runTestCase.js] ---*/ -function testcase() { function foo() { } var o = {}; var bf = foo.bind(o); - if (bf.hasOwnProperty('length')) { - return true; - } - } -runTestCase(testcase); + +assert(bf.hasOwnProperty('length'), 'bf.hasOwnProperty("length") !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-2.js b/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-2.js index 75311a772f..d0aedf9065 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-2.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-2.js @@ -6,16 +6,11 @@ es5id: 15.3.4.5-13.b-2 description: > Function.prototype.bind, 'length' set to remaining number of expected args -includes: [runTestCase.js] ---*/ -function testcase() { function foo(x, y) { } var o = {}; var bf = foo.bind(o); - if (bf.length === 2) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(bf.length, 2, 'bf.length'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-3.js b/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-3.js index 050357d3bc..b2a968ed3a 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-3.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-3.js @@ -6,16 +6,11 @@ es5id: 15.3.4.5-13.b-3 description: > Function.prototype.bind, 'length' set to remaining number of expected args (all args prefilled) -includes: [runTestCase.js] ---*/ -function testcase() { function foo(x, y) { } var o = {}; var bf = foo.bind(o, 42, 101); - if (bf.length === 0) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(bf.length, 0, 'bf.length'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-4.js b/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-4.js index e2b94af54e..152d1eb8bc 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-4.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-4.js @@ -6,16 +6,11 @@ es5id: 15.3.4.5-13.b-4 description: > Function.prototype.bind, 'length' set to remaining number of expected args (target takes 0 args) -includes: [runTestCase.js] ---*/ -function testcase() { function foo() { } var o = {}; var bf = foo.bind(o); - if (bf.length === 0) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(bf.length, 0, 'bf.length'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-5.js b/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-5.js index beea6de45c..fcf6139fa6 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-5.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-5.js @@ -6,16 +6,11 @@ es5id: 15.3.4.5-13.b-5 description: > Function.prototype.bind, 'length' set to remaining number of expected args (target provided extra args) -includes: [runTestCase.js] ---*/ -function testcase() { function foo() { } var o = {}; var bf = foo.bind(o, 42); - if (bf.length === 0) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(bf.length, 0, 'bf.length'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-6.js b/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-6.js index a3cd85f006..038084b1aa 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-6.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-13.b-6.js @@ -6,16 +6,11 @@ es5id: 15.3.4.5-13.b-6 description: > Function.prototype.bind, 'length' set to remaining number of expected args -includes: [runTestCase.js] ---*/ -function testcase() { function foo(x, y) { } var o = {}; var bf = foo.bind(o, 42); - if (bf.length === 1) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(bf.length, 1, 'bf.length'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-15-1.js b/test/built-ins/Function/prototype/bind/15.3.4.5-15-1.js index d1369cd85b..ff341342eb 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-15-1.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-15-1.js @@ -4,19 +4,14 @@ /*--- es5id: 15.3.4.5-15-1 description: Function.prototype.bind, 'length' is a data valued own property -includes: [runTestCase.js] ---*/ -function testcase() { function foo() { } var o = {}; var bf = foo.bind(o); var desc = Object.getOwnPropertyDescriptor(bf, 'length'); - if (desc.hasOwnProperty('value') === true && - desc.hasOwnProperty('get') === false && - desc.hasOwnProperty('set') === false) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(desc.hasOwnProperty('value'), true, 'desc.hasOwnProperty("value")'); +assert.sameValue(desc.hasOwnProperty('get'), false, 'desc.hasOwnProperty("get")'); +assert.sameValue(desc.hasOwnProperty('set'), false, 'desc.hasOwnProperty("set")'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-15-2.js b/test/built-ins/Function/prototype/bind/15.3.4.5-15-2.js index b5f5556172..19ed95b0d1 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-15-2.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-15-2.js @@ -5,20 +5,15 @@ es5id: 15.3.4.5-15-2 description: > Function.prototype.bind, 'length' is a data valued own property -includes: [runTestCase.js] ---*/ -function testcase() { function foo() { } var o = {}; var bf = foo.bind(o); var desc = Object.getOwnPropertyDescriptor(bf, 'length'); - if (desc.value === 0 && - desc.enumerable === false && - desc.writable === false && - desc.configurable == true) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(desc.value, 0, 'desc.value'); +assert.sameValue(desc.enumerable, false, 'desc.enumerable'); +assert.sameValue(desc.writable, false, 'desc.writable'); +assert.sameValue(desc.configurable, true, 'desc.configurable'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-15-4.js b/test/built-ins/Function/prototype/bind/15.3.4.5-15-4.js index 6e12d4557c..f0f5a41e6e 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-15-4.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-15-4.js @@ -6,11 +6,8 @@ es5id: 15.3.4.5-15-4 description: > Function.prototype.bind - The [[Enumerable]] attribute of length property in F set as false -includes: [runTestCase.js] ---*/ -function testcase() { - var canEnumerable = false; var hasProperty = false; function foo() { } @@ -21,6 +18,6 @@ function testcase() { canEnumerable = true; } } - return hasProperty && !canEnumerable; - } -runTestCase(testcase); + +assert(hasProperty, 'hasProperty !== true'); +assert.sameValue(canEnumerable, false, 'canEnumerable'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-15-5.js b/test/built-ins/Function/prototype/bind/15.3.4.5-15-5.js index 389b3970c7..e18bfc126c 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-15-5.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-15-5.js @@ -6,11 +6,8 @@ es5id: 15.3.4.5-15-5 description: > Function.prototype.bind - The [[Configurable]] attribute of length property in F set as false -includes: [runTestCase.js] ---*/ -function testcase() { - var canConfigurable = false; var hasProperty = false; function foo() { } @@ -18,6 +15,6 @@ function testcase() { hasProperty = obj.hasOwnProperty("length"); delete obj.caller; canConfigurable = !obj.hasOwnProperty("length"); - return hasProperty && !canConfigurable; - } -runTestCase(testcase); + +assert(hasProperty, 'hasProperty !== true'); +assert.sameValue(canConfigurable, false, 'canConfigurable'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-16-1.js b/test/built-ins/Function/prototype/bind/15.3.4.5-16-1.js index 95d1fde645..385cc179a3 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-16-1.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-16-1.js @@ -4,17 +4,12 @@ /*--- es5id: 15.3.4.5-16-1 description: Function.prototype.bind, [[Extensible]] of the bound fn is true -includes: [runTestCase.js] ---*/ -function testcase() { function foo() { } var o = {}; var bf = foo.bind(o); var ex = Object.isExtensible(bf); - if (ex === true) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(ex, true, 'ex'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-16-2.js b/test/built-ins/Function/prototype/bind/15.3.4.5-16-2.js index 72c2c728db..0a1d795413 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-16-2.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-16-2.js @@ -6,14 +6,10 @@ es5id: 15.3.4.5-16-2 description: > Function.prototype.bind - The [[Extensible]] attribute of internal property in F set as true -includes: [runTestCase.js] ---*/ -function testcase() { - function foo() { } var obj = foo.bind({}); obj.property = 12; - return obj.hasOwnProperty("property"); - } -runTestCase(testcase); + +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-2-3.js b/test/built-ins/Function/prototype/bind/15.3.4.5-2-3.js index 210b25afea..42f593c0e7 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-2-3.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-2-3.js @@ -7,14 +7,9 @@ info: > is not callable. es5id: 15.3.4.5-2-3 description: Function.prototype.bind allows Target to be a constructor (Number) -includes: [runTestCase.js] ---*/ -function testcase() { var bnc = Number.bind(null); var n = bnc(42); - if (n === 42) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(n, 42, 'n'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-2-4.js b/test/built-ins/Function/prototype/bind/15.3.4.5-2-4.js index 6764bf45ae..f12ad20c9d 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-2-4.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-2-4.js @@ -7,14 +7,9 @@ info: > is not callable. es5id: 15.3.4.5-2-4 description: Function.prototype.bind allows Target to be a constructor (String) -includes: [runTestCase.js] ---*/ -function testcase() { var bsc = String.bind(null); var s = bsc("hello world"); - if (s === "hello world") { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(s, "hello world", 's'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-2-5.js b/test/built-ins/Function/prototype/bind/15.3.4.5-2-5.js index 1937bff3f2..2ff1bb4232 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-2-5.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-2-5.js @@ -7,14 +7,9 @@ info: > is not callable. es5id: 15.3.4.5-2-5 description: Function.prototype.bind allows Target to be a constructor (Boolean) -includes: [runTestCase.js] ---*/ -function testcase() { var bbc = Boolean.bind(null); var b = bbc(true); - if (b === true) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(b, true, 'b'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-2-6.js b/test/built-ins/Function/prototype/bind/15.3.4.5-2-6.js index ad9c06c450..585ebada93 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-2-6.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-2-6.js @@ -7,14 +7,9 @@ info: > is not callable. es5id: 15.3.4.5-2-6 description: Function.prototype.bind allows Target to be a constructor (Object) -includes: [runTestCase.js] ---*/ -function testcase() { var boc = Object.bind(null); var o = boc(42); - if (o == 42) { - return true; - } - } -runTestCase(testcase); + +assert((o == 42), '(o == 42) !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-2-8.js b/test/built-ins/Function/prototype/bind/15.3.4.5-2-8.js index 0341e9a7f2..44e02b0feb 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-2-8.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-2-8.js @@ -7,15 +7,13 @@ info: > is not callable. es5id: 15.3.4.5-2-8 description: Function.prototype.bind allows Target to be a constructor (Array) -includes: [runTestCase.js] ---*/ -function testcase() { var bac = Array.bind(null); var a = bac(42); a.prop = "verifyPropertyExist"; a[41] = 41; - return a.prop === "verifyPropertyExist" && a[41] === 41 && a.length === 42; - } -runTestCase(testcase); +assert.sameValue(a.prop, "verifyPropertyExist", 'a.prop'); +assert.sameValue(a[41], 41, 'a[41]'); +assert.sameValue(a.length, 42, 'a.length'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-2-9.js b/test/built-ins/Function/prototype/bind/15.3.4.5-2-9.js index e1d170bd17..337e8b6da2 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-2-9.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-2-9.js @@ -4,14 +4,9 @@ /*--- es5id: 15.3.4.5-2-9 description: Function.prototype.bind allows Target to be a constructor (Date) -includes: [runTestCase.js] ---*/ -function testcase() { var bdc = Date.bind(null); var s = bdc(0, 0, 0); - if (typeof(s) === 'string') { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(typeof(s), 'string', 'typeof(s)'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-3-1.js b/test/built-ins/Function/prototype/bind/15.3.4.5-3-1.js index b965110c37..0a88f6d3b7 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-3-1.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-3-1.js @@ -4,17 +4,13 @@ /*--- es5id: 15.3.4.5-3-1 description: Function.prototype.bind - each arg is defined in A in list order -includes: [runTestCase.js] ---*/ -function testcase() { - var foo = function (x, y) { return new Boolean((x + y) === "ab" && arguments[0] === "a" && arguments[1] === "b" && arguments.length === 2); }; var obj = foo.bind({}, "a", "b"); - return obj()==true; - } -runTestCase(testcase); + +assert((obj() == true), '(obj() == true) !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-6-1.js b/test/built-ins/Function/prototype/bind/15.3.4.5-6-1.js index ccd2a6e634..89e32473e2 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-6-1.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-6-1.js @@ -4,15 +4,11 @@ /*--- es5id: 15.3.4.5-6-1 description: Function.prototype.bind - F can get own data property -includes: [runTestCase.js] ---*/ -function testcase() { - var foo = function () { }; var obj = foo.bind({}); obj.property = 12; - return obj.property === 12; - } -runTestCase(testcase); + +assert.sameValue(obj.property, 12, 'obj.property'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-6-12.js b/test/built-ins/Function/prototype/bind/15.3.4.5-6-12.js index c3b423b976..416294bc0d 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-6-12.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-6-12.js @@ -4,14 +4,10 @@ /*--- es5id: 15.3.4.5-6-12 description: Function.prototype.bind - F cannot get property which doesn't exist -includes: [runTestCase.js] ---*/ -function testcase() { - var foo = function () { }; var obj = foo.bind({}); - return typeof (obj.property) === "undefined"; - } -runTestCase(testcase); + +assert.sameValue(typeof (obj.property), "undefined", 'typeof (obj.property)'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-6-5.js b/test/built-ins/Function/prototype/bind/15.3.4.5-6-5.js index ef978517e1..e75c71ee19 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-6-5.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-6-5.js @@ -4,11 +4,8 @@ /*--- es5id: 15.3.4.5-6-5 description: Function.prototype.bind - F can get own accessor property -includes: [runTestCase.js] ---*/ -function testcase() { - var foo = function () { }; var obj = foo.bind({}); @@ -17,6 +14,5 @@ function testcase() { return 12; } }); - return obj.property === 12; - } -runTestCase(testcase); + +assert.sameValue(obj.property, 12, 'obj.property'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-6-9.js b/test/built-ins/Function/prototype/bind/15.3.4.5-6-9.js index 53c8ed36d4..bedb8acfb8 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-6-9.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-6-9.js @@ -6,17 +6,14 @@ es5id: 15.3.4.5-6-9 description: > Function.prototype.bind - F can get own accessor property without a get function -includes: [runTestCase.js] ---*/ -function testcase() { - var foo = function () { }; var obj = foo.bind({}); Object.defineProperty(obj, "property", { set: function () {} }); - return obj.hasOwnProperty("property") && typeof (obj.property) === "undefined"; - } -runTestCase(testcase); + +assert(obj.hasOwnProperty("property"), 'obj.hasOwnProperty("property") !== true'); +assert.sameValue(typeof (obj.property), "undefined", 'typeof (obj.property)'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-8-1.js b/test/built-ins/Function/prototype/bind/15.3.4.5-8-1.js index cef3e444c8..3ef542bdc8 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-8-1.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-8-1.js @@ -4,16 +4,11 @@ /*--- es5id: 15.3.4.5-8-1 description: Function.prototype.bind, type of bound function must be 'function' -includes: [runTestCase.js] ---*/ -function testcase() { function foo() { } var o = {}; var bf = foo.bind(o); - if (typeof(bf) === 'function') { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(typeof(bf), 'function', 'typeof(bf)'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-8-2.js b/test/built-ins/Function/prototype/bind/15.3.4.5-8-2.js index afd7c22554..cc9ca589be 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-8-2.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-8-2.js @@ -6,17 +6,12 @@ es5id: 15.3.4.5-8-2 description: > Function.prototype.bind, [[Class]] of bound function must be 'Function' -includes: [runTestCase.js] ---*/ -function testcase() { function foo() { } var o = {}; var bf = foo.bind(o); var s = Object.prototype.toString.call(bf); - if (s === '[object Function]') { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(s, '[object Function]', 's'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-9-1.js b/test/built-ins/Function/prototype/bind/15.3.4.5-9-1.js index 4713401c5e..ff231a57bc 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-9-1.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-9-1.js @@ -4,16 +4,11 @@ /*--- es5id: 15.3.4.5-9-1 description: Function.prototype.bind, [[Prototype]] is Function.prototype -includes: [runTestCase.js] ---*/ -function testcase() { function foo() { } var o = {}; var bf = foo.bind(o); - if (Function.prototype.isPrototypeOf(bf)) { - return true; - } - } -runTestCase(testcase); + +assert(Function.prototype.isPrototypeOf(bf), 'Function.prototype.isPrototypeOf(bf) !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5-9-2.js b/test/built-ins/Function/prototype/bind/15.3.4.5-9-2.js index 4ba8bfb70b..597e3ca158 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5-9-2.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5-9-2.js @@ -6,16 +6,11 @@ es5id: 15.3.4.5-9-2 description: > Function.prototype.bind, [[Prototype]] is Function.prototype (using getPrototypeOf) -includes: [runTestCase.js] ---*/ -function testcase() { function foo() { } var o = {}; var bf = foo.bind(o); - if (Object.getPrototypeOf(bf) === Function.prototype) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(Object.getPrototypeOf(bf), Function.prototype, 'Object.getPrototypeOf(bf)'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-1.js b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-1.js index 01bc793149..9d386aa4fd 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-1.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-1.js @@ -7,16 +7,12 @@ description: > [[Call]] - 'F''s [[BoundArgs]] is used as the former part of arguments of calling the [[Call]] internal method of 'F''s [[TargetFunction]] when 'F' is called -includes: [runTestCase.js] ---*/ -function testcase() { var func = function (x, y, z) { return x + y + z; }; var newFunc = Function.prototype.bind.call(func, {}, "a", "b", "c"); - return newFunc() === "abc"; - } -runTestCase(testcase); +assert.sameValue(newFunc(), "abc", 'newFunc()'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-10.js b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-10.js index 28b861ff2a..13c4a05bc7 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-10.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-10.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-10 description: > [[Call]] - length of parameters of 'target' is 1, length of 'boundArgs' is 0, length of 'ExtraArgs' is 0, and with 'boundThis' -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { prop: "abc" }; var func = function (x) { @@ -18,6 +16,4 @@ function testcase() { var newFunc = Function.prototype.bind.call(func, obj); - return newFunc(); - } -runTestCase(testcase); +assert(newFunc(), 'newFunc() !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-11.js b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-11.js index 4b0772ee8b..162dfdbc2c 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-11.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-11.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-11 description: > [[Call]] - length of parameters of 'target' is 1, length of 'boundArgs' is 0, length of 'ExtraArgs' is 1, and with 'boundThis' -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { prop: "abc" }; var func = function (x) { @@ -18,6 +16,4 @@ function testcase() { var newFunc = Function.prototype.bind.call(func, obj); - return newFunc(1); - } -runTestCase(testcase); +assert(newFunc(1), 'newFunc(1) !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-12.js b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-12.js index b05454d8fc..0185bd3e22 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-12.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-12.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-12 description: > [[Call]] - length of parameters of 'target' is 1, length of 'boundArgs' is 0, length of 'ExtraArgs' is 2, and with 'boundThis' -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { prop: "abc" }; var func = function (x) { @@ -19,6 +17,4 @@ function testcase() { var newFunc = Function.prototype.bind.call(func, obj); - return newFunc(1, 2); - } -runTestCase(testcase); +assert(newFunc(1, 2), 'newFunc(1, 2) !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-13.js b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-13.js index 15d41c24d1..477b95d8ed 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-13.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-13.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-13 description: > [[Call]] - length of parameters of 'target' is 1, length of 'boundArgs' is 1, length of 'ExtraArgs' is 0, and with 'boundThis' -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { prop: "abc" }; var func = function (x) { @@ -19,6 +17,4 @@ function testcase() { var newFunc = Function.prototype.bind.call(func, obj, 1); - return newFunc(); - } -runTestCase(testcase); +assert(newFunc(), 'newFunc() !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-14.js b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-14.js index 57a637d71a..ed401e8b60 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-14.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-14.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-14 description: > [[Call]] - length of parameters of 'target' is 1, length of 'boundArgs' is 1, length of 'ExtraArgs' is 1, and with 'boundThis' -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { prop: "abc" }; var func = function (x) { @@ -19,6 +17,4 @@ function testcase() { var newFunc = Function.prototype.bind.call(func, obj, 1); - return newFunc(2); - } -runTestCase(testcase); +assert(newFunc(2), 'newFunc(2) !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-15.js b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-15.js index f953a00c5b..772059d8fd 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-15.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-15.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-15 description: > [[Call]] - length of parameters of 'target' is 1, length of 'boundArgs' is 2, length of 'ExtraArgs' is 0, and with 'boundThis' -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { prop: "abc" }; var func = function (x) { @@ -19,6 +17,4 @@ function testcase() { var newFunc = Function.prototype.bind.call(func, obj, 1, 2); - return newFunc(); - } -runTestCase(testcase); +assert(newFunc(), 'newFunc() !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-2.js b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-2.js index 5595ea541e..329b1e78c5 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-2.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-2.js @@ -7,10 +7,8 @@ description: > [[Call]] - 'F''s [[BoundThis]] is used as the 'this' value of calling the [[Call]] internal method of 'F''s [[TargetFunction]] when 'F' is called -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { "prop": "a" }; var func = function () { @@ -19,6 +17,4 @@ function testcase() { var newFunc = Function.prototype.bind.call(func, obj); - return newFunc() === obj; - } -runTestCase(testcase); +assert.sameValue(newFunc(), obj, 'newFunc()'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-3.js b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-3.js index 6ab430e7fa..c0bb824d0a 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-3.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-3.js @@ -7,16 +7,12 @@ description: > [[Call]] - the provided arguments is used as the latter part of arguments of calling the [[Call]] internal method of 'F''s [[TargetFunction]] when 'F' is called -includes: [runTestCase.js] ---*/ -function testcase() { var func = function (x, y, z) { return z; }; var newFunc = Function.prototype.bind.call(func, {}, "a", "b"); - return newFunc("c") === "c"; - } -runTestCase(testcase); +assert.sameValue(newFunc("c"), "c", 'newFunc("c")'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-4.js b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-4.js index 2dd9c95344..829615fff5 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-4.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-4.js @@ -7,16 +7,12 @@ description: > [[Call]] - length of parameters of 'target' is 0, length of 'boundArgs' is 0, length of 'ExtraArgs' is 0, and without 'boundThis' -includes: [runTestCase.js] ---*/ -function testcase() { var func = function () { return arguments.length === 0; }; var newFunc = Function.prototype.bind.call(func); - return newFunc(); - } -runTestCase(testcase); +assert(newFunc(), 'newFunc() !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-5.js b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-5.js index 0afb26fe71..7342bbdd38 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-5.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-5.js @@ -7,16 +7,12 @@ description: > [[Call]] - length of parameters of 'target' is 0, length of 'boundArgs' is 0, length of 'ExtraArgs' is 1, and without 'boundThis' -includes: [runTestCase.js] ---*/ -function testcase() { var func = function () { return arguments[0] === 1; }; var newFunc = Function.prototype.bind.call(func); - return newFunc(1); - } -runTestCase(testcase); +assert(newFunc(1), 'newFunc(1) !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-6.js b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-6.js index c2af948ce9..88da5973ce 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-6.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-6.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-6 description: > [[Call]] - length of parameters of 'target' is 0, length of 'boundArgs' is 0, length of 'ExtraArgs' is 0, and with 'boundThis' -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { prop: "abc" }; var func = function () { @@ -18,6 +16,4 @@ function testcase() { var newFunc = Function.prototype.bind.call(func, obj); - return newFunc(); - } -runTestCase(testcase); +assert(newFunc(), 'newFunc() !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-7.js b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-7.js index 3a8724c357..2e90afd021 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-7.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-7.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-7 description: > [[Call]] - length of parameters of 'target' is 0, length of 'boundArgs' is 1, length of 'ExtraArgs' is 0, and with 'boundThis' -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { prop: "abc" }; var func = function () { @@ -18,6 +16,4 @@ function testcase() { var newFunc = Function.prototype.bind.call(func, obj, 1); - return newFunc(); - } -runTestCase(testcase); +assert(newFunc(), 'newFunc() !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-8.js b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-8.js index 18773caadb..7203696e82 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-8.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-8.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-8 description: > [[Call]] - length of parameters of 'target' is 0, length of 'boundArgs' is 0, length of 'ExtraArgs' is 1, and with 'boundThis' -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { prop: "abc" }; var func = function () { @@ -18,6 +16,4 @@ function testcase() { var newFunc = Function.prototype.bind.call(func, obj); - return newFunc(1); - } -runTestCase(testcase); +assert(newFunc(1), 'newFunc(1) !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-9.js b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-9.js index 014b48640d..496a18584f 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-9.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.1-4-9.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.1-4-9 description: > [[Call]] - length of parameters of 'target' is 0, length of 'boundArgs' is 1, length of 'ExtraArgs' is 1, and with 'boundThis' -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { prop: "abc" }; var func = function () { @@ -18,6 +16,4 @@ function testcase() { var newFunc = Function.prototype.bind.call(func, obj, 1); - return newFunc(2); - } -runTestCase(testcase); +assert(newFunc(2), 'newFunc(2) !== true'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-1.js b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-1.js index 82b394e80d..5088d7335c 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-1.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-1.js @@ -7,10 +7,8 @@ description: > [[Construct]] - 'F''s [[BoundArgs]] is used as the former part of arguments of calling the [[Construct]] internal method of 'F''s [[TargetFunction]] when 'F' is called as constructor -includes: [runTestCase.js] ---*/ -function testcase() { var func = function (x, y, z) { var objResult = {}; objResult.returnValue = x + y + z; @@ -22,7 +20,7 @@ function testcase() { var newInstance = new NewFunc(); - return newInstance.hasOwnProperty("returnValue") && newInstance.returnValue === "abc" && - newInstance.hasOwnProperty("returnVerifyResult") && newInstance.returnVerifyResult === true; - } -runTestCase(testcase); +assert(newInstance.hasOwnProperty("returnValue"), 'newInstance.hasOwnProperty("returnValue") !== true'); +assert.sameValue(newInstance.returnValue, "abc", 'newInstance.returnValue'); +assert(newInstance.hasOwnProperty("returnVerifyResult"), 'newInstance.hasOwnProperty("returnVerifyResult") !== true'); +assert.sameValue(newInstance.returnVerifyResult, true, 'newInstance.returnVerifyResult'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-10.js b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-10.js index c7243f68c2..c3a9014e1d 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-10.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-10.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-10 description: > [[Construct]] - length of parameters of 'target' is 1, length of 'boundArgs' is 0, length of 'ExtraArgs' is 1 -includes: [runTestCase.js] ---*/ -function testcase() { var func = function (x) { return new Boolean(arguments.length === 1 && x === 1 && arguments[0] === 1); }; @@ -18,6 +16,4 @@ function testcase() { var newInstance = new NewFunc(1); - return newInstance.valueOf() === true; - } -runTestCase(testcase); +assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-11.js b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-11.js index 58252a450f..1d385d0819 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-11.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-11.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-11 description: > [[Construct]] - length of parameters of 'target' is 1, length of 'boundArgs' is 0, length of 'ExtraArgs' is 2 -includes: [runTestCase.js] ---*/ -function testcase() { var func = function (x) { return new Boolean(arguments.length === 2 && x === 1 && arguments[1] === 2 && arguments[0] === 1); }; @@ -18,6 +16,4 @@ function testcase() { var newInstance = new NewFunc(1, 2); - return newInstance.valueOf() === true; - } -runTestCase(testcase); +assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-12.js b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-12.js index 293c7567c8..2a3ab1bf23 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-12.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-12.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-12 description: > [[Construct]] - length of parameters of 'target' is 1, length of 'boundArgs' is 1, length of 'ExtraArgs' is 0 -includes: [runTestCase.js] ---*/ -function testcase() { var func = function (x) { return new Boolean(arguments.length === 1 && x === 1 && arguments[0] === 1); }; @@ -18,6 +16,4 @@ function testcase() { var newInstance = new NewFunc(); - return newInstance.valueOf() === true; - } -runTestCase(testcase); +assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-13.js b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-13.js index 327f63551d..ad86f0904e 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-13.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-13.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-13 description: > [[Construct]] - length of parameters of 'target' is 1, length of 'boundArgs' is 1, length of 'ExtraArgs' is 1 -includes: [runTestCase.js] ---*/ -function testcase() { var func = function (x) { return new Boolean(arguments.length === 2 && x === 1 && arguments[1] === 2 && arguments[0] === 1); }; @@ -18,6 +16,4 @@ function testcase() { var newInstance = new NewFunc(2); - return newInstance.valueOf() === true; - } -runTestCase(testcase); +assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-14.js b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-14.js index 0b42174daa..e893ad5a8e 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-14.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-14.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-14 description: > [[Construct]] - length of parameters of 'target' is 1, length of 'boundArgs' is 2, length of 'ExtraArgs' is 0 -includes: [runTestCase.js] ---*/ -function testcase() { var func = function (x) { return new Boolean(arguments.length === 2 && x === 1 && arguments[1] === 2 && arguments[0] === 1); }; @@ -18,6 +16,4 @@ function testcase() { var newInstance = new NewFunc(); - return newInstance.valueOf() === true; - } -runTestCase(testcase); +assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-2.js b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-2.js index f203a43dda..cdee9fae61 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-2.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-2.js @@ -7,10 +7,8 @@ description: > [[Construct]] - the provided arguments is used as the latter part of arguments of calling the [[Construct]] internal method of 'F''s [[TargetFunction]] when 'F' is called as constructor -includes: [runTestCase.js] ---*/ -function testcase() { var func = function (x, y, z) { var objResult = {}; objResult.returnValue = x + y + z; @@ -22,7 +20,7 @@ function testcase() { var newInstance = new NewFunc("a", "b", "c"); - return newInstance.hasOwnProperty("returnValue") && newInstance.returnValue === "abc" && - newInstance.hasOwnProperty("returnVerifyResult") && newInstance.returnVerifyResult === true; - } -runTestCase(testcase); +assert(newInstance.hasOwnProperty("returnValue"), 'newInstance.hasOwnProperty("returnValue") !== true'); +assert.sameValue(newInstance.returnValue, "abc", 'newInstance.returnValue'); +assert(newInstance.hasOwnProperty("returnVerifyResult"), 'newInstance.hasOwnProperty("returnVerifyResult") !== true'); +assert.sameValue(newInstance.returnVerifyResult, true, 'newInstance.returnVerifyResult'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-3.js b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-3.js index e49b5af510..535e38e0e9 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-3.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-3.js @@ -7,10 +7,8 @@ description: > [[Construct]] - length of parameters of 'target' is 0, length of 'boundArgs' is 0, length of 'ExtraArgs' is 0, and without 'boundThis' -includes: [runTestCase.js] ---*/ -function testcase() { var func = function () { return new Boolean(arguments.length === 0); }; @@ -19,6 +17,4 @@ function testcase() { var newInstance = new NewFunc(); - return newInstance.valueOf() === true; - } -runTestCase(testcase); +assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-4.js b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-4.js index 0e898b9ab7..2fdf32fd38 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-4.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-4.js @@ -7,10 +7,8 @@ description: > [[Construct]] - length of parameters of 'target' is 0, length of 'boundArgs' is 0, length of 'ExtraArgs' is 1, and without 'boundThis' -includes: [runTestCase.js] ---*/ -function testcase() { var func = function () { return new Boolean(arguments[0] === 1 && arguments.length === 1); }; @@ -19,6 +17,4 @@ function testcase() { var newInstance = new NewFunc(1); - return newInstance.valueOf() === true; - } -runTestCase(testcase); +assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-6.js b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-6.js index 0e5da98777..1afb3b7cf5 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-6.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-6.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-6 description: > [[Construct]] - length of parameters of 'target' is 0, length of 'boundArgs' is 1, length of 'ExtraArgs' is 0 -includes: [runTestCase.js] ---*/ -function testcase() { var func = function () { return new Boolean(arguments.length === 1 && arguments[0] === 1); }; @@ -18,6 +16,4 @@ function testcase() { var newInstance = new NewFunc(); - return newInstance.valueOf() === true; - } -runTestCase(testcase); +assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-7.js b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-7.js index b662d1471c..085e9545e6 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-7.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-7.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-7 description: > [[Construct]] - length of parameters of 'target' is 0, length of 'boundArgs' is 0, length of 'ExtraArgs' is 1 -includes: [runTestCase.js] ---*/ -function testcase() { var func = function () { return new Boolean(arguments.length === 1 && arguments[0] === 1); }; @@ -18,6 +16,4 @@ function testcase() { var newInstance = new NewFunc(1); - return newInstance.valueOf() === true; - } -runTestCase(testcase); +assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-8.js b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-8.js index 570a43462c..4207a187cf 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-8.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-8.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-8 description: > [[Construct]] - length of parameters of 'target' is 0, length of 'boundArgs' is 1, length of 'ExtraArgs' is 1 -includes: [runTestCase.js] ---*/ -function testcase() { var func = function () { return new Boolean(arguments.length === 2 && arguments[0] === 1 && arguments[1] === 2); }; @@ -18,6 +16,4 @@ function testcase() { var newInstance = new NewFunc(2); - return newInstance.valueOf() === true; - } -runTestCase(testcase); +assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()'); diff --git a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-9.js b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-9.js index 3bca8e3c73..4c25b405d9 100644 --- a/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-9.js +++ b/test/built-ins/Function/prototype/bind/15.3.4.5.2-4-9.js @@ -6,10 +6,8 @@ es5id: 15.3.4.5.2-4-9 description: > [[Construct]] - length of parameters of 'target' is 1, length of 'boundArgs' is 0, length of 'ExtraArgs' is 0 -includes: [runTestCase.js] ---*/ -function testcase() { var func = function (x) { return new Boolean(arguments.length === 0 && typeof x === "undefined"); }; @@ -18,6 +16,4 @@ function testcase() { var newInstance = new NewFunc(); - return newInstance.valueOf() === true; - } -runTestCase(testcase); +assert.sameValue(newInstance.valueOf(), true, 'newInstance.valueOf()'); diff --git a/test/built-ins/Function/prototype/call/15.3.4.4-1-s.js b/test/built-ins/Function/prototype/call/15.3.4.4-1-s.js index 4a8d8d0639..a4f618bb16 100644 --- a/test/built-ins/Function/prototype/call/15.3.4.4-1-s.js +++ b/test/built-ins/Function/prototype/call/15.3.4.4-1-s.js @@ -8,13 +8,10 @@ description: > to wrapper objects when the function is called without an array of arguments flags: [onlyStrict] -includes: [runTestCase.js] ---*/ -function testcase() { function fun() { return (this instanceof String); } - return !fun.call(""); - } -runTestCase(testcase); + +assert.sameValue(fun.call(""), false, 'fun.call("")'); diff --git a/test/built-ins/Function/prototype/call/15.3.4.4-2-s.js b/test/built-ins/Function/prototype/call/15.3.4.4-2-s.js index 1603a9ea25..687003b5cd 100644 --- a/test/built-ins/Function/prototype/call/15.3.4.4-2-s.js +++ b/test/built-ins/Function/prototype/call/15.3.4.4-2-s.js @@ -8,13 +8,10 @@ description: > to wrapper objects when the function is called without an array argument flags: [onlyStrict] -includes: [runTestCase.js] ---*/ -function testcase() { function fun() { return (this instanceof Number); } - return !fun.call(-12); - } -runTestCase(testcase); + +assert.sameValue(fun.call(-12), false, 'fun.call(-12)'); diff --git a/test/built-ins/Function/prototype/call/15.3.4.4-3-s.js b/test/built-ins/Function/prototype/call/15.3.4.4-3-s.js index 9f79f2cac7..a92bdea11d 100644 --- a/test/built-ins/Function/prototype/call/15.3.4.4-3-s.js +++ b/test/built-ins/Function/prototype/call/15.3.4.4-3-s.js @@ -8,13 +8,10 @@ description: > to wrapper objects when the function is called without an array of arguments flags: [onlyStrict] -includes: [runTestCase.js] ---*/ -function testcase() { function fun() { return (this instanceof Boolean); } - return !fun.call(false); - } -runTestCase(testcase); + +assert.sameValue(fun.call(false), false, 'fun.call(false)');