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