mirror of https://github.com/tc39/test262.git
Replace runTestCase with assert helpers [test/built-ins/RegExp]
This commit is contained in:
parent
6cd7b9e275
commit
50c29deb29
|
@ -4,11 +4,8 @@
|
|||
/*---
|
||||
es5id: 15.10.6
|
||||
description: RegExp.prototype is itself a not RegExp
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var s = Object.prototype.toString.call(RegExp.prototype);
|
||||
return s === '[object Object]';
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(s, '[object Object]', 's');
|
||||
|
|
|
@ -6,14 +6,11 @@ es5id: 15.10.6.2-9-e-1
|
|||
description: >
|
||||
RegExp.prototype.exec - the removed step 9.e won't affected
|
||||
current algorithm
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var str = "Hello World!";
|
||||
var regObj = new RegExp("World");
|
||||
var result = false;
|
||||
result = regObj.exec(str).toString() === "World";
|
||||
return result;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert(result, 'result !== true');
|
||||
|
|
|
@ -6,17 +6,12 @@ es5id: 15.10.7.2-2
|
|||
description: >
|
||||
RegExp.prototype.global is an accessor property whose set accessor
|
||||
function is undefined
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var desc = Object.getOwnPropertyDescriptor(RegExp.prototype, 'global');
|
||||
|
||||
if (typeof desc.get === 'function' &&
|
||||
desc.set === undefined &&
|
||||
desc.enumerable === false &&
|
||||
desc.configurable === true) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(typeof desc.get, 'function', 'typeof desc.get');
|
||||
assert.sameValue(desc.set, undefined, 'desc.set');
|
||||
assert.sameValue(desc.enumerable, false, 'desc.enumerable');
|
||||
assert.sameValue(desc.configurable, true, 'desc.configurable');
|
||||
|
|
|
@ -6,17 +6,12 @@ es5id: 15.10.7.3-2
|
|||
description: >
|
||||
RegExp.prototype.ignoreCase is an accessor property whose set
|
||||
accessor function is undefined
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var d = Object.getOwnPropertyDescriptor(RegExp.prototype, 'ignoreCase');
|
||||
|
||||
if (typeof d.get === 'function' &&
|
||||
d.set === undefined &&
|
||||
d.enumerable === false &&
|
||||
d.configurable === true) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(typeof d.get, 'function', 'typeof d.get');
|
||||
assert.sameValue(d.set, undefined, 'd.set');
|
||||
assert.sameValue(d.enumerable, false, 'd.enumerable');
|
||||
assert.sameValue(d.configurable, true, 'd.configurable');
|
||||
|
|
|
@ -4,11 +4,8 @@
|
|||
/*---
|
||||
es5id: 15.10.7.5-2
|
||||
description: RegExp.prototype.lastIndex is not present
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var d = Object.getOwnPropertyDescriptor(RegExp.prototype, 'lastIndex');
|
||||
return d === undefined;
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(d, undefined, 'd');
|
||||
|
|
|
@ -6,17 +6,12 @@ es5id: 15.10.7.4-2
|
|||
description: >
|
||||
RegExp.prototype.multiline is an accessor property whose set
|
||||
accessor function is undefined
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var d = Object.getOwnPropertyDescriptor(RegExp.prototype, 'multiline');
|
||||
|
||||
if (typeof d.get === 'function' &&
|
||||
d.set === undefined &&
|
||||
d.enumerable === false &&
|
||||
d.configurable === true) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(typeof d.get, 'function', 'typeof d.get');
|
||||
assert.sameValue(d.set, undefined, 'd.set');
|
||||
assert.sameValue(d.enumerable, false, 'd.enumerable');
|
||||
assert.sameValue(d.configurable, true, 'd.configurable');
|
||||
|
|
|
@ -6,17 +6,12 @@ es5id: 15.10.7.1-2
|
|||
description: >
|
||||
RegExp.prototype.source is an accessor property whose set accessor
|
||||
function is undefined
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var d = Object.getOwnPropertyDescriptor(RegExp.prototype, 'source');
|
||||
|
||||
if (typeof d.get === 'function' &&
|
||||
d.set === undefined &&
|
||||
d.enumerable === false &&
|
||||
d.configurable === true) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
|
||||
assert.sameValue(typeof d.get, 'function', 'typeof d.get');
|
||||
assert.sameValue(d.set, undefined, 'd.set');
|
||||
assert.sameValue(d.enumerable, false, 'd.enumerable');
|
||||
assert.sameValue(d.configurable, true, 'd.configurable');
|
||||
|
|
Loading…
Reference in New Issue