Replace runTestCase with assert helpers [test/language/statements/for]

This commit is contained in:
André Bargull 2015-08-06 18:32:38 +02:00
parent efabdf8474
commit 713df280e5
21 changed files with 42 additions and 105 deletions

View File

@ -11,16 +11,13 @@ es5id: 12.6.3_2-3-a-ii-1
description: >
The for Statement - (normal, V, empty) will be returned when first
Expression is an Object with value false
includes: [runTestCase.js]
---*/
function testcase() {
var accessed = false;
var obj = { value: false };
for (var i = 0; obj; ) {
accessed = true;
break;
}
return accessed;
}
runTestCase(testcase);
assert(accessed, 'accessed !== true');

View File

@ -11,16 +11,13 @@ es5id: 12.6.3_2-3-a-ii-10
description: >
The for Statement - (normal, V, empty) will be returned when first
Expression is a String object (value is '1')
includes: [runTestCase.js]
---*/
function testcase() {
var accessed = false;
var strObj = new String("1");
for (var i = 0; strObj;) {
accessed = true;
break;
}
return accessed;
}
runTestCase(testcase);
assert(accessed, 'accessed !== true');

View File

@ -11,14 +11,11 @@ es5id: 12.6.3_2-3-a-ii-11
description: >
The for Statement - (normal, V, empty) will be returned when first
Expression is undefined
includes: [runTestCase.js]
---*/
function testcase() {
var count = 0;
for (var i = 0; undefined;) {
count++;
}
return count === 0;
}
runTestCase(testcase);
assert.sameValue(count, 0, 'count');

View File

@ -11,14 +11,11 @@ es5id: 12.6.3_2-3-a-ii-12
description: >
The for Statement - (normal, V, empty) will be returned when first
Expression is null
includes: [runTestCase.js]
---*/
function testcase() {
var count = 0;
for (var i = 0; null;) {
count++;
}
return count === 0;
}
runTestCase(testcase);
assert.sameValue(count, 0, 'count');

View File

@ -11,14 +11,11 @@ es5id: 12.6.3_2-3-a-ii-13
description: >
The for Statement - (normal, V, empty) will be returned when first
Expression is a boolean (value is false)
includes: [runTestCase.js]
---*/
function testcase() {
var count = 0;
for (var i = 0; false;) {
count++;
}
return count === 0;
}
runTestCase(testcase);
assert.sameValue(count, 0, 'count');

View File

@ -11,14 +11,11 @@ es5id: 12.6.3_2-3-a-ii-14
description: >
The for Statement - (normal, V, empty) will be returned when first
Expression is a number (value is NaN)
includes: [runTestCase.js]
---*/
function testcase() {
var count = 0;
for (var i = 0; NaN;) {
count++;
}
return count === 0;
}
runTestCase(testcase);
assert.sameValue(count, 0, 'count');

View File

@ -11,14 +11,11 @@ es5id: 12.6.3_2-3-a-ii-15
description: >
The for Statement - (normal, V, empty) will be returned when first
Expression is a number (value is +0)
includes: [runTestCase.js]
---*/
function testcase() {
var count = 0;
for (var i = 0; +0;) {
count++;
}
return count === 0;
}
runTestCase(testcase);
assert.sameValue(count, 0, 'count');

View File

@ -11,14 +11,11 @@ es5id: 12.6.3_2-3-a-ii-16
description: >
The for Statement - (normal, V, empty) will be returned when first
Expression is a number (value is -0)
includes: [runTestCase.js]
---*/
function testcase() {
var count = 0;
for (var i = 0; -0;) {
count++;
}
return count === 0;
}
runTestCase(testcase);
assert.sameValue(count, 0, 'count');

View File

@ -11,15 +11,12 @@ es5id: 12.6.3_2-3-a-ii-17
description: >
The for Statement - (normal, V, empty) will be returned when first
Expression is a number (value is a positive)
includes: [runTestCase.js]
---*/
function testcase() {
var accessed = false;
for (var i = 0; 2;) {
accessed = true;
break;
}
return accessed;
}
runTestCase(testcase);
assert(accessed, 'accessed !== true');

View File

@ -11,14 +11,11 @@ es5id: 12.6.3_2-3-a-ii-18
description: >
The for Statement - (normal, V, empty) will be returned when first
Expression is a string (value is empty string)
includes: [runTestCase.js]
---*/
function testcase() {
var count = 0;
for (var i = 0; "";) {
count++;
}
return count === 0;
}
runTestCase(testcase);
assert.sameValue(count, 0, 'count');

View File

@ -11,15 +11,12 @@ es5id: 12.6.3_2-3-a-ii-19
description: >
The for Statement - (normal, V, empty) will be returned when first
Expression is a string (value is 'undefined')
includes: [runTestCase.js]
---*/
function testcase() {
var accessed = false;
for (var i = 0; "undefined";) {
accessed = true;
break;
}
return accessed;
}
runTestCase(testcase);
assert(accessed, 'accessed !== true');

View File

@ -11,16 +11,13 @@ es5id: 12.6.3_2-3-a-ii-2
description: >
The for Statement - (normal, V, empty) will be returned when first
Expression is a Boolean object
includes: [runTestCase.js]
---*/
function testcase() {
var accessed = false;
var boolObj = new Boolean(false);
for (var i = 0; boolObj;) {
accessed = true;
break;
}
return accessed;
}
runTestCase(testcase);
assert(accessed, 'accessed !== true');

View File

@ -11,15 +11,12 @@ es5id: 12.6.3_2-3-a-ii-20
description: >
The for Statement - (normal, V, empty) will be returned when first
Expression is a string (value is 'null')
includes: [runTestCase.js]
---*/
function testcase() {
var accessed = false;
for (var i = 0; "null";) {
accessed = true;
break;
}
return accessed;
}
runTestCase(testcase);
assert(accessed, 'accessed !== true');

View File

@ -11,15 +11,12 @@ es5id: 12.6.3_2-3-a-ii-21
description: >
The for Statement - (normal, V, empty) will be returned when first
Expression is a string (value is '1')
includes: [runTestCase.js]
---*/
function testcase() {
var accessed = false;
for (var i = 0; "1";) {
accessed = true;
break;
}
return accessed;
}
runTestCase(testcase);
assert(accessed, 'accessed !== true');

View File

@ -11,16 +11,13 @@ es5id: 12.6.3_2-3-a-ii-3
description: >
The for Statement - (normal, V, empty) will be returned when first
Expression is a Number object (value is NaN)
includes: [runTestCase.js]
---*/
function testcase() {
var accessed = false;
var numObj = new Number(NaN);
for (var i = 0; numObj;) {
accessed = true;
break;
}
return accessed;
}
runTestCase(testcase);
assert(accessed, 'accessed !== true');

View File

@ -11,16 +11,13 @@ es5id: 12.6.3_2-3-a-ii-4
description: >
The for Statement - (normal, V, empty) will be returned when first
Expression is a Number object (value is +0)
includes: [runTestCase.js]
---*/
function testcase() {
var accessed = false;
var numObj = new Number(+0);
for (var i = 0; numObj;) {
accessed = true;
break;
}
return accessed;
}
runTestCase(testcase);
assert(accessed, 'accessed !== true');

View File

@ -11,16 +11,13 @@ es5id: 12.6.3_2-3-a-ii-5
description: >
The for Statement - (normal, V, empty) will be returned when first
Expression is a Number object (value is -0)
includes: [runTestCase.js]
---*/
function testcase() {
var accessed = false;
var numObj = new Number(-0);
for (var i = 0; numObj;) {
accessed = true;
break;
}
return accessed;
}
runTestCase(testcase);
assert(accessed, 'accessed !== true');

View File

@ -11,16 +11,13 @@ es5id: 12.6.3_2-3-a-ii-6
description: >
The for Statement - (normal, V, empty) will be returned when first
Expression is a Number object (value is a positive)
includes: [runTestCase.js]
---*/
function testcase() {
var accessed = false;
var numObj = new Number(12);
for (var i = 0; numObj;) {
accessed = true;
break;
}
return accessed;
}
runTestCase(testcase);
assert(accessed, 'accessed !== true');

View File

@ -11,16 +11,13 @@ es5id: 12.6.3_2-3-a-ii-7
description: >
The for Statement - (normal, V, empty) will be returned when first
Expression is a String object (value is empty string)
includes: [runTestCase.js]
---*/
function testcase() {
var accessed = false;
var strObj = new String("");
for (var i = 0; strObj;) {
accessed = true;
break;
}
return accessed;
}
runTestCase(testcase);
assert(accessed, 'accessed !== true');

View File

@ -11,16 +11,13 @@ es5id: 12.6.3_2-3-a-ii-8
description: >
The for Statement - (normal, V, empty) will be returned when first
Expression is a String object (value is 'undefined')
includes: [runTestCase.js]
---*/
function testcase() {
var accessed = false;
var strObj = new String("undefined");
for (var i = 0; strObj;) {
accessed = true;
break;
}
return accessed;
}
runTestCase(testcase);
assert(accessed, 'accessed !== true');

View File

@ -11,16 +11,13 @@ es5id: 12.6.3_2-3-a-ii-9
description: >
The for Statement - (normal, V, empty) will be returned when first
Expression is a String object (value is 'null')
includes: [runTestCase.js]
---*/
function testcase() {
var accessed = false;
var strObj = new String("null");
for (var i = 0; strObj;) {
accessed = true;
break;
}
return accessed;
}
runTestCase(testcase);
assert(accessed, 'accessed !== true');