mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Remove parallelarray tests.
This commit is contained in:
parent
a86553e6e6
commit
64aae39e91
@ -1,10 +0,0 @@
|
||||
|
||||
function combineArray() {
|
||||
var p = new ParallelArray([0,1,2,3,4]);
|
||||
var a = [1,2,3,4,5];
|
||||
var r = p.combine(function (idx) { return this[idx] + a[idx];});
|
||||
assertEq(r.toString(), [1,3,5,7,9].join(","));
|
||||
}
|
||||
|
||||
combineArray();
|
||||
|
@ -1,10 +0,0 @@
|
||||
|
||||
function combineParallelArray() {
|
||||
var p = new ParallelArray([0,1,2,3,4]);
|
||||
var a = new ParallelArray([1,2,3,4,5]);
|
||||
var r = p.combine(function (idx) { return this[idx] + a[idx];});
|
||||
assertEq(r.toString(), [1,3,5,7,9].join(","));
|
||||
}
|
||||
|
||||
combineParallelArray();
|
||||
|
@ -1,9 +0,0 @@
|
||||
|
||||
function buildComprehension() {
|
||||
var p = new ParallelArray(10, function (idx) { return idx;});
|
||||
var a = [0,1,2,3,4,5,6,7,8,9];
|
||||
// correct result
|
||||
assertEq(p.toString(),a.join(","));
|
||||
}
|
||||
|
||||
buildComprehension();
|
@ -1,13 +0,0 @@
|
||||
|
||||
function buildWithHoles() {
|
||||
var a = new Array(5);
|
||||
for (var cnt = 0; cnt < a.length; cnt+=2) {
|
||||
a[cnt] = cnt;
|
||||
}
|
||||
var b = [0,1,2,3,4];
|
||||
var p = new ParallelArray(a);
|
||||
// check no holes
|
||||
assertEq(Object.keys(p).join(","), Object.keys(b).join(","));
|
||||
}
|
||||
|
||||
buildWithHoles();
|
@ -1,13 +0,0 @@
|
||||
|
||||
function buildSimple() {
|
||||
var a = [1,2,3,4,5];
|
||||
var p = new ParallelArray(a);
|
||||
var e = a.join(",");
|
||||
// correct result
|
||||
assertEq(p.toString(),e);
|
||||
a[0] = 9;
|
||||
// no sharing
|
||||
assertEq(p.toString(),e);
|
||||
}
|
||||
|
||||
buildSimple();
|
@ -1,9 +0,0 @@
|
||||
|
||||
function testFilterAll() {
|
||||
var even = function (i) { return (i%2 === 0); };
|
||||
var p = new ParallelArray([0,1,2,3,4]);
|
||||
var r = p.filter(even);
|
||||
assertEq(r.toString(), [0,2,4].join(","));
|
||||
}
|
||||
|
||||
testFilterAll();
|
@ -1,9 +0,0 @@
|
||||
|
||||
function testFilterNone() {
|
||||
var none = function () { return false; };
|
||||
var p = new ParallelArray([0,1,2,3,4]);
|
||||
var r = p.filter(none);
|
||||
assertEq(r.toString(), "");
|
||||
}
|
||||
|
||||
testFilterNone();
|
@ -1,9 +0,0 @@
|
||||
|
||||
function testFilterSome() {
|
||||
var evenBelowThree = function (i) { return ((i%2) === 0) && (i < 3); };
|
||||
var p = new ParallelArray([0,1,2,3,4]);
|
||||
var r = p.filter(evenBelowThree);
|
||||
assertEq(r.toString(), [0,2].join(","));
|
||||
}
|
||||
|
||||
testFilterSome();
|
@ -1,8 +0,0 @@
|
||||
function GetOwnProperyDescriptor() {
|
||||
var p = new ParallelArray([9]);
|
||||
assertEq(Object.getOwnPropertyDescriptor(p, "length").toSource(), {configurable:false, enumerable:false, value:1, writable:false}.toSource());
|
||||
assertEq(Object.getOwnPropertyDescriptor(p, "0").toSource(), {configurable:false, enumerable:true, value:9, writable:false}.toSource());
|
||||
}
|
||||
|
||||
GetOwnProperyDescriptor();
|
||||
|
@ -1,8 +0,0 @@
|
||||
|
||||
function testMapExtras() {
|
||||
var p = new ParallelArray([0,1,2,3,4]);
|
||||
var m = p.map(function (v, e) { return v+e; }, [1,2,3,4,5]);
|
||||
assertEq(m.toString(), [1,3,5,7,9].join(","));
|
||||
}
|
||||
|
||||
testMapExtras();
|
@ -1,8 +0,0 @@
|
||||
|
||||
function testMap() {
|
||||
var p = new ParallelArray([0,1,2,3,4]);
|
||||
var m = p.map(function (v) { return v+1; });
|
||||
assertEq(m.toString(), [1,2,3,4,5].join(","));
|
||||
}
|
||||
|
||||
testMap();
|
@ -1,8 +0,0 @@
|
||||
|
||||
function testReduceNone() {
|
||||
var p = new ParallelArray([]);
|
||||
var r = p.reduce(function (v, p) { return v*p; });
|
||||
assertEq(r, undefined);
|
||||
}
|
||||
|
||||
testReduceNone();
|
@ -1,8 +0,0 @@
|
||||
|
||||
function testReduceOne() {
|
||||
var p = new ParallelArray([1]);
|
||||
var r = p.reduce(function (v, p) { return v*p; });
|
||||
assertEq(r, 1);
|
||||
}
|
||||
|
||||
testReduceOne();
|
@ -1,8 +0,0 @@
|
||||
|
||||
function testReduce() {
|
||||
var p = new ParallelArray([1,2,3,4,5]);
|
||||
var r = p.reduce(function (v, p) { return v*p; });
|
||||
assertEq(r, 120);
|
||||
}
|
||||
|
||||
testReduce();
|
@ -1,9 +0,0 @@
|
||||
// |jit-test| error: Error;
|
||||
|
||||
function testScatterBounds() {
|
||||
var p = new ParallelArray([1,2,3,4,5]);
|
||||
var r = p.scatter([0,2,11]);
|
||||
}
|
||||
|
||||
testScatterBounds();
|
||||
|
@ -1,8 +0,0 @@
|
||||
|
||||
function testScatterConflict() {
|
||||
var p = new ParallelArray([1,2,3,4,5]);
|
||||
var r = p.scatter([0,1,0,3,4], 9, function (a,b) { return a+b; });
|
||||
assertEq(r.toString(),[4,2,9,4,5].join(","));
|
||||
}
|
||||
|
||||
testScatterConflict();
|
@ -1,8 +0,0 @@
|
||||
// |jit-test| error: Error;
|
||||
|
||||
function testScatterConflictFail() {
|
||||
var p = new ParallelArray([1,2,3,4,5]);
|
||||
var r = p.scatter([0,1,0,3,4], 9); // should fail
|
||||
}
|
||||
|
||||
testScatterConflictFail();
|
@ -1,9 +0,0 @@
|
||||
|
||||
function testScatterDefault() {
|
||||
var p = new ParallelArray([1,2,3,4,5]);
|
||||
var r = p.scatter([0,2,4], 9);
|
||||
assertEq(r.toString(),[1,9,2,9,3].join(","));
|
||||
}
|
||||
|
||||
testScatterDefault();
|
||||
|
@ -1,9 +0,0 @@
|
||||
|
||||
function testScatterIdentity() {
|
||||
var p = new ParallelArray([1,2,3,4,5]);
|
||||
var r = p.scatter([0,1,2,3,4]);
|
||||
assertEq(p.toString(),r.toString());
|
||||
}
|
||||
|
||||
testScatterIdentity();
|
||||
|
@ -1,8 +0,0 @@
|
||||
|
||||
function testScatterLength() {
|
||||
var p = new ParallelArray([1,2,3,4,5]);
|
||||
var r = p.scatter([0,1,0,3,4], 9, function (a,b) { return a+b; }, 10);
|
||||
assertEq(r.length,10);
|
||||
}
|
||||
|
||||
testScatterLength();
|
Loading…
Reference in New Issue
Block a user