restructure test directory

This commit is contained in:
Sebastian McKenzie
2014-10-11 22:42:31 +11:00
parent a1b2da49d7
commit bb9b7455b5
312 changed files with 24 additions and 25 deletions

View File

@@ -0,0 +1 @@
var seattlers = [for (customers of countries) for (c of customers) if (c.city == "Seattle") { name: c.name, age: c.age }];

View File

@@ -0,0 +1,14 @@
var seattlers = function () {
var _arr = [];
countries.forEach(function (customers) {
customers.forEach(function (c) {
if (c.city == "Seattle") {
_arr.push({
name: c.name,
age: c.age
});
}
});
});
return _arr;
}();

View File

@@ -0,0 +1 @@
var arr = [for (x of "abcdefgh".split("")) for (y of "12345678".split("")) (x + y)];

View File

@@ -0,0 +1,11 @@
var arr = (function () {
var _arr = [];
"abcdefgh".split("").forEach(function (x) {
"12345678".split("").forEach(function (y) {
_arr.push(x + y);
});
});
return _arr;
})();

View File

@@ -0,0 +1 @@
var arr = [for (i in [1, 2, 3]) i * i];

View File

@@ -0,0 +1,3 @@
{
"throws": "for-in array comprehension is not supported"
}

View File

@@ -0,0 +1 @@
var seattlers = [for (c of customers) if (c.city == "Seattle") { name: c.name, age: c.age }];

View File

@@ -0,0 +1,8 @@
var seattlers = customers.filter(function (c) {
return c.city == "Seattle";
}).map(function (c) {
return {
name: c.name,
age: c.age
};
});

View File

@@ -0,0 +1 @@
var arr = [for (i of [1, 2, 3]) i * i];

View File

@@ -0,0 +1,3 @@
var arr = [1, 2, 3].map(function (i) {
return i * i;
});