mirror of
https://github.com/tc39/test262.git
synced 2025-07-05 13:14:38 +02:00
Replace runTestCase with assert helpers [test/built-ins/Error]
This commit is contained in:
parent
60a2879133
commit
cf231fb03b
@ -7,12 +7,9 @@ description: >
|
|||||||
Error.prototype.toString return the result of concatenating
|
Error.prototype.toString return the result of concatenating
|
||||||
'name', ':', a single space character, and 'msg' when 'name' and
|
'name', ':', a single space character, and 'msg' when 'name' and
|
||||||
'msg' are non-empty string
|
'msg' are non-empty string
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var errObj = new Error("ErrorMessage");
|
var errObj = new Error("ErrorMessage");
|
||||||
errObj.name = "ErrorName";
|
errObj.name = "ErrorName";
|
||||||
return errObj.toString() === "ErrorName: ErrorMessage";
|
|
||||||
}
|
assert.sameValue(errObj.toString(), "ErrorName: ErrorMessage", 'errObj.toString()');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,11 +6,8 @@ es5id: 15.11.4.4-6-1
|
|||||||
description: >
|
description: >
|
||||||
Error.prototype.toString - 'Error' is returned when 'name' is
|
Error.prototype.toString - 'Error' is returned when 'name' is
|
||||||
absent and empty string is returned when 'msg' is undefined
|
absent and empty string is returned when 'msg' is undefined
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var errObj = new Error();
|
var errObj = new Error();
|
||||||
return errObj.toString() === "Error";
|
|
||||||
}
|
assert.sameValue(errObj.toString(), "Error", 'errObj.toString()');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -7,11 +7,8 @@ description: >
|
|||||||
Error.prototype.toString - 'Error' is returned when 'name' is
|
Error.prototype.toString - 'Error' is returned when 'name' is
|
||||||
absent and value of 'msg' is returned when 'msg' is non-empty
|
absent and value of 'msg' is returned when 'msg' is non-empty
|
||||||
string
|
string
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var errObj = new Error("ErrorMessage");
|
var errObj = new Error("ErrorMessage");
|
||||||
return errObj.toString() === "Error: ErrorMessage";
|
|
||||||
}
|
assert.sameValue(errObj.toString(), "Error: ErrorMessage", 'errObj.toString()');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,12 +6,9 @@ es5id: 15.11.4.4-8-1
|
|||||||
description: >
|
description: >
|
||||||
Error.prototype.toString return the value of 'msg' when 'name' is
|
Error.prototype.toString return the value of 'msg' when 'name' is
|
||||||
empty string and 'msg' isn't undefined
|
empty string and 'msg' isn't undefined
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var errObj = new Error("ErrorMessage");
|
var errObj = new Error("ErrorMessage");
|
||||||
errObj.name = "";
|
errObj.name = "";
|
||||||
return errObj.toString() === "ErrorMessage";
|
|
||||||
}
|
assert.sameValue(errObj.toString(), "ErrorMessage", 'errObj.toString()');
|
||||||
runTestCase(testcase);
|
|
||||||
|
@ -6,12 +6,9 @@ es5id: 15.11.4.4-9-1
|
|||||||
description: >
|
description: >
|
||||||
Error.prototype.toString return 'name' when 'name' is non-empty
|
Error.prototype.toString return 'name' when 'name' is non-empty
|
||||||
string and 'msg' is empty string
|
string and 'msg' is empty string
|
||||||
includes: [runTestCase.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function testcase() {
|
|
||||||
var errObj = new Error();
|
var errObj = new Error();
|
||||||
errObj.name = "ErrorName";
|
errObj.name = "ErrorName";
|
||||||
return errObj.toString() === "ErrorName";
|
|
||||||
}
|
assert.sameValue(errObj.toString(), "ErrorName", 'errObj.toString()');
|
||||||
runTestCase(testcase);
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user