Skip to content
Snippets Groups Projects
Commit 2fe6cac1 authored by André Bargull's avatar André Bargull
Browse files

Replace runTestCase with assert helpers [test/language/reserved-words]

parent ba1b02a0
No related branches found
No related tags found
No related merge requests found
Showing
with 20 additions and 160 deletions
......@@ -6,10 +6,8 @@ es5id: 7.6.1-1-1
description: >
Allow reserved words as property names at object initialization,
verified with hasOwnProperty: null, true, false
includes: [runTestCase.js]
---*/
function testcase(){
var tokenCodes = {
null: 0,
true: 1,
......@@ -23,12 +21,7 @@ function testcase(){
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
if(!tokenCodes.hasOwnProperty(arr[p1])) {
return false;
};
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
return true;
}
runTestCase(testcase);
......@@ -6,10 +6,8 @@ es5id: 7.6.1-1-10
description: >
Allow reserved words as property names at object initialization,
verified with hasOwnProperty: in, try, class
includes: [runTestCase.js]
---*/
function testcase(){
var tokenCodes = {
in: 0,
try: 1,
......@@ -23,12 +21,7 @@ function testcase(){
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
if(!tokenCodes.hasOwnProperty(arr[p1])) {
return false;
};
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
return true;
}
runTestCase(testcase);
......@@ -6,10 +6,8 @@ es5id: 7.6.1-1-11
description: >
Allow reserved words as property names at object initialization,
verified with hasOwnProperty: enum, extends, super
includes: [runTestCase.js]
---*/
function testcase(){
var tokenCodes = {
enum: 0,
extends: 1,
......@@ -23,12 +21,7 @@ function testcase(){
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
if(!tokenCodes.hasOwnProperty(arr[p1])) {
return false;
};
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
return true;
}
runTestCase(testcase);
......@@ -6,10 +6,8 @@ es5id: 7.6.1-1-12
description: >
Allow reserved words as property names at object initialization,
verified with hasOwnProperty: const, export, import
includes: [runTestCase.js]
---*/
function testcase(){
var tokenCodes = {
const: 0,
export: 1,
......@@ -23,12 +21,7 @@ function testcase(){
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
if(!tokenCodes.hasOwnProperty(arr[p1])) {
return false;
};
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
return true;
}
runTestCase(testcase);
......@@ -6,10 +6,8 @@ es5id: 7.6.1-1-13
description: >
Allow reserved words as property names at object initialization,
verified with hasOwnProperty: implements, let, private
includes: [runTestCase.js]
---*/
function testcase(){
var tokenCodes = {
implements: 0,
let: 1,
......@@ -23,12 +21,7 @@ function testcase(){
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
if(!tokenCodes.hasOwnProperty(arr[p1])) {
return false;
};
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
return true;
}
runTestCase(testcase);
......@@ -6,10 +6,8 @@ es5id: 7.6.1-1-14
description: >
Allow reserved words as property names at object initialization,
verified with hasOwnProperty: public, yield, interface
includes: [runTestCase.js]
---*/
function testcase(){
var tokenCodes = {
public: 0,
yield: 1,
......@@ -23,12 +21,7 @@ function testcase(){
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
if(!tokenCodes.hasOwnProperty(arr[p1])) {
return false;
};
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
return true;
}
runTestCase(testcase);
......@@ -6,10 +6,8 @@ es5id: 7.6.1-1-15
description: >
Allow reserved words as property names at object initialization,
verified with hasOwnProperty: package, protected, static
includes: [runTestCase.js]
---*/
function testcase(){
var tokenCodes = {
package: 0,
protected: 1,
......@@ -23,12 +21,7 @@ function testcase(){
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
if(!tokenCodes.hasOwnProperty(arr[p1])) {
return false;
};
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
return true;
}
runTestCase(testcase);
......@@ -6,10 +6,8 @@ es5id: 7.6.1-1-16
description: >
Allow reserved words as property names at object initialization,
verified with hasOwnProperty: undeefined, NaN, Infinity
includes: [runTestCase.js]
---*/
function testcase(){
var tokenCodes = {
undefined: 0,
NaN: 1,
......@@ -23,12 +21,7 @@ function testcase(){
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
if(!tokenCodes.hasOwnProperty(arr[p1])) {
return false;
};
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
return true;
}
runTestCase(testcase);
......@@ -6,10 +6,8 @@ es5id: 7.6.1-1-2
description: >
Allow reserved words as property names at object initialization,
verified with hasOwnProperty: break, case, do
includes: [runTestCase.js]
---*/
function testcase(){
var tokenCodes = {
break: 0,
case: 1,
......@@ -23,12 +21,7 @@ function testcase(){
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
if(!tokenCodes.hasOwnProperty(arr[p1])) {
return false;
};
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
return true;
}
runTestCase(testcase);
......@@ -6,10 +6,8 @@ es5id: 7.6.1-1-3
description: >
Allow reserved words as property names at object initialization,
verified with hasOwnProperty: instanceof, typeof, else
includes: [runTestCase.js]
---*/
function testcase(){
var tokenCodes = {
instanceof: 0,
typeof: 1,
......@@ -23,12 +21,7 @@ function testcase(){
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
if(!tokenCodes.hasOwnProperty(arr[p1])) {
return false;
};
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
return true;
}
runTestCase(testcase);
......@@ -6,10 +6,8 @@ es5id: 7.6.1-1-4
description: >
Allow reserved words as property names at object initialization,
verified with hasOwnProperty: new, var, catch
includes: [runTestCase.js]
---*/
function testcase(){
var tokenCodes = {
new: 0,
var: 1,
......@@ -23,12 +21,7 @@ function testcase(){
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
if(!tokenCodes.hasOwnProperty(arr[p1])) {
return false;
};
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
return true;
}
runTestCase(testcase);
......@@ -6,10 +6,8 @@ es5id: 7.6.1-1-5
description: >
Allow reserved words as property names at object initialization,
verified with hasOwnProperty: finally, return, void
includes: [runTestCase.js]
---*/
function testcase(){
var tokenCodes = {
finally: 0,
return: 1,
......@@ -23,12 +21,7 @@ function testcase(){
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
if(!tokenCodes.hasOwnProperty(arr[p1])) {
return false;
};
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
return true;
}
runTestCase(testcase);
......@@ -6,10 +6,8 @@ es5id: 7.6.1-1-6
description: >
Allow reserved words as property names at object initialization,
verified with hasOwnProperty: continue, for, switch
includes: [runTestCase.js]
---*/
function testcase(){
var tokenCodes = {
continue: 0,
for: 1,
......@@ -23,12 +21,7 @@ function testcase(){
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
if(!tokenCodes.hasOwnProperty(arr[p1])) {
return false;
};
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
return true;
}
runTestCase(testcase);
......@@ -6,10 +6,8 @@ es5id: 7.6.1-1-7
description: >
Allow reserved words as property names at object initialization,
verified with hasOwnProperty: while, debugger, function
includes: [runTestCase.js]
---*/
function testcase(){
var tokenCodes = {
while: 0,
debugger: 1,
......@@ -23,12 +21,7 @@ function testcase(){
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
if(!tokenCodes.hasOwnProperty(arr[p1])) {
return false;
};
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
return true;
}
runTestCase(testcase);
......@@ -6,10 +6,8 @@ es5id: 7.6.1-1-8
description: >
Allow reserved words as property names at object initialization,
verified with hasOwnProperty: this, with, default
includes: [runTestCase.js]
---*/
function testcase(){
var tokenCodes = {
this: 0,
with: 1,
......@@ -23,12 +21,7 @@ function testcase(){
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
if(!tokenCodes.hasOwnProperty(arr[p1])) {
return false;
};
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
return true;
}
runTestCase(testcase);
......@@ -6,10 +6,8 @@ es5id: 7.6.1-1-9
description: >
Allow reserved words as property names at object initialization,
verified with hasOwnProperty: if, throw, delete
includes: [runTestCase.js]
---*/
function testcase(){
var tokenCodes = {
if: 0,
throw: 1,
......@@ -23,12 +21,7 @@ function testcase(){
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
if(!tokenCodes.hasOwnProperty(arr[p1])) {
return false;
};
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
return true;
}
runTestCase(testcase);
......@@ -6,10 +6,8 @@ es5id: 7.6.1-2-1
description: >
Allow reserved words as property names by dot operator assignment,
verified with hasOwnProperty: null, true, false
includes: [runTestCase.js]
---*/
function testcase() {
var tokenCodes = {};
tokenCodes.null = 0;
tokenCodes.true = 1;
......@@ -22,12 +20,7 @@ function testcase() {
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
if(!tokenCodes.hasOwnProperty(arr[p1])) {
return false;
};
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
return true;
}
runTestCase(testcase);
......@@ -6,10 +6,8 @@ es5id: 7.6.1-2-10
description: >
Allow reserved words as property names by dot operator assignment,
verified with hasOwnProperty: in, try, class
includes: [runTestCase.js]
---*/
function testcase() {
var tokenCodes = {};
tokenCodes.in = 0;
tokenCodes.try = 1;
......@@ -22,12 +20,7 @@ function testcase() {
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
if(!tokenCodes.hasOwnProperty(arr[p1])) {
return false;
};
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
return true;
}
runTestCase(testcase);
......@@ -6,10 +6,8 @@ es5id: 7.6.1-2-11
description: >
Allow reserved words as property names by dot operator assignment,
verified with hasOwnProperty: enum, extends, super
includes: [runTestCase.js]
---*/
function testcase() {
var tokenCodes = {};
tokenCodes.enum = 0;
tokenCodes.extends = 1;
......@@ -22,12 +20,7 @@ function testcase() {
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
if(!tokenCodes.hasOwnProperty(arr[p1])) {
return false;
};
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
return true;
}
runTestCase(testcase);
......@@ -6,10 +6,8 @@ es5id: 7.6.1-2-12
description: >
Allow reserved words as property names by dot operator assignment,
verified with hasOwnProperty: const, export, import
includes: [runTestCase.js]
---*/
function testcase() {
var tokenCodes = {};
tokenCodes.const = 0;
tokenCodes.export = 1;
......@@ -22,12 +20,7 @@ function testcase() {
for(var p in tokenCodes) {
for(var p1 in arr) {
if(arr[p1] === p) {
if(!tokenCodes.hasOwnProperty(arr[p1])) {
return false;
};
assert(tokenCodes.hasOwnProperty(arr[p1]), 'tokenCodes.hasOwnProperty(arr[p1]) !== true');
}
}
}
return true;
}
runTestCase(testcase);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment