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: > description: >
The for Statement - (normal, V, empty) will be returned when first The for Statement - (normal, V, empty) will be returned when first
Expression is an Object with value false Expression is an Object with value false
includes: [runTestCase.js]
---*/ ---*/
function testcase() {
var accessed = false; var accessed = false;
var obj = { value: false }; var obj = { value: false };
for (var i = 0; obj; ) { for (var i = 0; obj; ) {
accessed = true; accessed = true;
break; break;
} }
return accessed;
} assert(accessed, 'accessed !== true');
runTestCase(testcase);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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