Replace runTestCase with assert helpers [test/built-ins/Error]

This commit is contained in:
André Bargull 2015-08-06 18:24:55 +02:00
parent 60a2879133
commit cf231fb03b
5 changed files with 10 additions and 25 deletions

View File

@ -7,12 +7,9 @@ description: >
Error.prototype.toString return the result of concatenating
'name', ':', a single space character, and 'msg' when 'name' and
'msg' are non-empty string
includes: [runTestCase.js]
---*/
function testcase() {
var errObj = new Error("ErrorMessage");
errObj.name = "ErrorName";
return errObj.toString() === "ErrorName: ErrorMessage";
}
runTestCase(testcase);
assert.sameValue(errObj.toString(), "ErrorName: ErrorMessage", 'errObj.toString()');

View File

@ -6,11 +6,8 @@ es5id: 15.11.4.4-6-1
description: >
Error.prototype.toString - 'Error' is returned when 'name' is
absent and empty string is returned when 'msg' is undefined
includes: [runTestCase.js]
---*/
function testcase() {
var errObj = new Error();
return errObj.toString() === "Error";
}
runTestCase(testcase);
assert.sameValue(errObj.toString(), "Error", 'errObj.toString()');

View File

@ -7,11 +7,8 @@ description: >
Error.prototype.toString - 'Error' is returned when 'name' is
absent and value of 'msg' is returned when 'msg' is non-empty
string
includes: [runTestCase.js]
---*/
function testcase() {
var errObj = new Error("ErrorMessage");
return errObj.toString() === "Error: ErrorMessage";
}
runTestCase(testcase);
assert.sameValue(errObj.toString(), "Error: ErrorMessage", 'errObj.toString()');

View File

@ -6,12 +6,9 @@ es5id: 15.11.4.4-8-1
description: >
Error.prototype.toString return the value of 'msg' when 'name' is
empty string and 'msg' isn't undefined
includes: [runTestCase.js]
---*/
function testcase() {
var errObj = new Error("ErrorMessage");
errObj.name = "";
return errObj.toString() === "ErrorMessage";
}
runTestCase(testcase);
assert.sameValue(errObj.toString(), "ErrorMessage", 'errObj.toString()');

View File

@ -6,12 +6,9 @@ es5id: 15.11.4.4-9-1
description: >
Error.prototype.toString return 'name' when 'name' is non-empty
string and 'msg' is empty string
includes: [runTestCase.js]
---*/
function testcase() {
var errObj = new Error();
errObj.name = "ErrorName";
return errObj.toString() === "ErrorName";
}
runTestCase(testcase);
assert.sameValue(errObj.toString(), "ErrorName", 'errObj.toString()');