diff --git a/test/built-ins/Date/15.9.1.15-1.js b/test/built-ins/Date/15.9.1.15-1.js index f712bffd6d..eef35a051e 100644 --- a/test/built-ins/Date/15.9.1.15-1.js +++ b/test/built-ins/Date/15.9.1.15-1.js @@ -7,15 +7,12 @@ description: > Date Time String Format - specified default values will be set for all optional fields(MM, DD, mm, ss and time zone) when they are absent -includes: [runTestCase.js] ---*/ -function testcase() { var result = false; var expectedDateTimeStr = new Date(1970, 0, 1, 0, 0, 0, 0).toISOString(); var dateObj = new Date("1970"); var dateStr = dateObj.toISOString(); result = dateStr === expectedDateTimeStr; - return result; - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/Date/now/15.9.4.4-0-3.js b/test/built-ins/Date/now/15.9.4.4-0-3.js index ff1749c444..324d8d7093 100644 --- a/test/built-ins/Date/now/15.9.4.4-0-3.js +++ b/test/built-ins/Date/now/15.9.4.4-0-3.js @@ -4,12 +4,8 @@ /*--- es5id: 15.9.4.4-0-3 description: Date.now must exist as a function -includes: [runTestCase.js] ---*/ -function testcase() { - var fun = Date.now; - return (typeof (fun) === "function"); - } -runTestCase(testcase); + +assert.sameValue(typeof (fun), "function", 'typeof (fun)'); diff --git a/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-11.js b/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-11.js index 6cc15fcd58..13a93f295d 100644 --- a/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-11.js +++ b/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-11.js @@ -7,16 +7,12 @@ description: > Date.prototype.toISOString - RangeError is not thrown when value of date is Date(1970, 0, 100000001, 0, 0, 0, -1), the time zone is UTC(0) -includes: [runTestCase.js] ---*/ -function testcase() { var timeZoneMinutes = new Date().getTimezoneOffset() * (-1); var date, dateStr; date = new Date(1970, 0, 100000001, 0, 0 + timeZoneMinutes - 60, 0, -1); dateStr = date.toISOString(); - return dateStr[dateStr.length - 1] === "Z"; - } -runTestCase(testcase); +assert.sameValue(dateStr[dateStr.length - 1], "Z", 'dateStr[dateStr.length - 1]'); diff --git a/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-12.js b/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-12.js index 594b5c2301..5d026d6ca6 100644 --- a/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-12.js +++ b/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-12.js @@ -7,16 +7,12 @@ description: > Date.prototype.toISOString - RangeError is not thrown when value of date is Date(1970, 0, 100000001, 0, 0, 0, 0), the time zone is UTC(0) -includes: [runTestCase.js] ---*/ -function testcase() { var timeZoneMinutes = new Date().getTimezoneOffset() * (-1); var date, dateStr; date = new Date(1970, 0, 100000001, 0, 0 + timeZoneMinutes - 60, 0, 0); dateStr = date.toISOString(); - return dateStr[dateStr.length - 1] === "Z"; - } -runTestCase(testcase); +assert.sameValue(dateStr[dateStr.length - 1], "Z", 'dateStr[dateStr.length - 1]'); diff --git a/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-4.js b/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-4.js index 947e5d480f..2b4e4c026a 100644 --- a/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-4.js +++ b/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-4.js @@ -6,13 +6,9 @@ es5id: 15.9.5.43-0-4 description: > Date.prototype.toISOString - format of returned string is 'YYYY-MM-DDTHH:mm:ss.sssZ', the time zone is UTC(0) -includes: [runTestCase.js] ---*/ -function testcase() { var date = new Date(1999, 9, 10, 10, 10, 10, 10); var localDate = new Date(date.getTime() - date.getTimezoneOffset() * 60000); - return localDate.toISOString() === "1999-10-10T10:10:10.010Z"; - } -runTestCase(testcase); +assert.sameValue(localDate.toISOString(), "1999-10-10T10:10:10.010Z", 'localDate.toISOString()'); diff --git a/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-5.js b/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-5.js index 0a73b528c3..3df6f20c9e 100644 --- a/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-5.js +++ b/test/built-ins/Date/prototype/toISOString/15.9.5.43-0-5.js @@ -6,11 +6,8 @@ es5id: 15.9.5.43-0-5 description: > Date.prototype.toISOString - The returned string is the UTC time zone(0) -includes: [runTestCase.js] ---*/ -function testcase() { var dateStr = (new Date()).toISOString(); - return dateStr[dateStr.length - 1] === "Z"; - } -runTestCase(testcase); + +assert.sameValue(dateStr[dateStr.length - 1], "Z", 'dateStr[dateStr.length - 1]'); diff --git a/test/built-ins/Date/prototype/toJSON/15.9.5.44-0-1.js b/test/built-ins/Date/prototype/toJSON/15.9.5.44-0-1.js index 4600c686e8..1796e5c426 100644 --- a/test/built-ins/Date/prototype/toJSON/15.9.5.44-0-1.js +++ b/test/built-ins/Date/prototype/toJSON/15.9.5.44-0-1.js @@ -4,13 +4,8 @@ /*--- es5id: 15.9.5.44-0-1 description: Date.prototype.toJSON must exist as a function -includes: [runTestCase.js] ---*/ -function testcase() { var f = Date.prototype.toJSON; - if (typeof(f) === "function") { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(typeof(f), "function", 'typeof(f)'); diff --git a/test/built-ins/Date/prototype/toJSON/15.9.5.44-0-2.js b/test/built-ins/Date/prototype/toJSON/15.9.5.44-0-2.js index 7fa161c1c9..aa8a77fe71 100644 --- a/test/built-ins/Date/prototype/toJSON/15.9.5.44-0-2.js +++ b/test/built-ins/Date/prototype/toJSON/15.9.5.44-0-2.js @@ -4,12 +4,6 @@ /*--- es5id: 15.9.5.44-0-2 description: Date.prototype.toJSON must exist as a function taking 1 parameter -includes: [runTestCase.js] ---*/ -function testcase() { - if (Date.prototype.toJSON.length === 1) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(Date.prototype.toJSON.length, 1, 'Date.prototype.toJSON.length');