Skip to content

Commit 8d41973

Browse files
fix: Unit tests
1 parent de4da2e commit 8d41973

File tree

1 file changed

+43
-43
lines changed

1 file changed

+43
-43
lines changed

test/index.js

+43-43
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ describe('gpuMock', () => {
352352
})();
353353

354354
assert.equal(results.constructor, Float32Array);
355-
assert.deepEqual(results, [0,1,2,3,4]);
355+
assert.deepEqual(results, Float32Array.from([0,1,2,3,4]));
356356
});
357357
it('can work with array', () => {
358358
const results = gpuMock(function(value) {
@@ -362,7 +362,7 @@ describe('gpuMock', () => {
362362
})([0,1,2,3,4]);
363363

364364
assert.equal(results.constructor, Float32Array);
365-
assert.deepEqual(results, [0,1,2,3,4]);
365+
assert.deepEqual(results, Float32Array.from([0,1,2,3,4]));
366366
});
367367
it('can work with array like constructor that has .toArray() (like texture and input)', () => {
368368
class MockValue {
@@ -377,7 +377,7 @@ describe('gpuMock', () => {
377377
})(new MockValue());
378378

379379
assert.equal(results.constructor, Float32Array);
380-
assert.deepEqual(results, [0,1,2,3,4]);
380+
assert.deepEqual(results, Float32Array.from([0,1,2,3,4]));
381381
});
382382
});
383383

@@ -393,11 +393,11 @@ describe('gpuMock', () => {
393393
assert.equal(results[0].constructor, Float32Array);
394394
assert.deepEqual(results,
395395
[
396-
[0,1,2,3,4],
397-
[1,2,3,4,5],
398-
[2,3,4,5,6],
399-
[3,4,5,6,7],
400-
[4,5,6,7,8]
396+
Float32Array.from([0,1,2,3,4]),
397+
Float32Array.from([1,2,3,4,5]),
398+
Float32Array.from([2,3,4,5,6]),
399+
Float32Array.from([3,4,5,6,7]),
400+
Float32Array.from([4,5,6,7,8])
401401
]
402402
);
403403
});
@@ -418,11 +418,11 @@ describe('gpuMock', () => {
418418
assert.equal(results[0].constructor, Float32Array);
419419
assert.deepEqual(results,
420420
[
421-
[1,2,3,4,5],
422-
[6,7,8,9,10],
423-
[11,12,13,14,15],
424-
[16,17,18,19,20],
425-
[21,22,23,24,25],
421+
Float32Array.from([1,2,3,4,5]),
422+
Float32Array.from([6,7,8,9,10]),
423+
Float32Array.from([11,12,13,14,15]),
424+
Float32Array.from([16,17,18,19,20]),
425+
Float32Array.from([21,22,23,24,25]),
426426
]
427427
);
428428
});
@@ -448,11 +448,11 @@ describe('gpuMock', () => {
448448
assert.equal(results[0].constructor, Float32Array);
449449
assert.deepEqual(results,
450450
[
451-
[1,2,3,4,5],
452-
[6,7,8,9,10],
453-
[11,12,13,14,15],
454-
[16,17,18,19,20],
455-
[21,22,23,24,25],
451+
Float32Array.from([1,2,3,4,5]),
452+
Float32Array.from([6,7,8,9,10]),
453+
Float32Array.from([11,12,13,14,15]),
454+
Float32Array.from([16,17,18,19,20]),
455+
Float32Array.from([21,22,23,24,25]),
456456
]
457457
);
458458
});
@@ -604,39 +604,39 @@ describe('gpuMock', () => {
604604
assert.deepEqual(results,
605605
[
606606
[
607-
[0,1,2,3,4],
608-
[1,2,3,4,5],
609-
[2,3,4,5,6],
610-
[3,4,5,6,7],
611-
[4,5,6,7,8]
607+
Float32Array.from([0,1,2,3,4]),
608+
Float32Array.from([1,2,3,4,5]),
609+
Float32Array.from([2,3,4,5,6]),
610+
Float32Array.from([3,4,5,6,7]),
611+
Float32Array.from([4,5,6,7,8])
612612
],
613613
[
614-
[1,2,3,4,5],
615-
[2,3,4,5,6],
616-
[3,4,5,6,7],
617-
[4,5,6,7,8],
618-
[5,6,7,8,9]
614+
Float32Array.from([1,2,3,4,5]),
615+
Float32Array.from([2,3,4,5,6]),
616+
Float32Array.from([3,4,5,6,7]),
617+
Float32Array.from([4,5,6,7,8]),
618+
Float32Array.from([5,6,7,8,9])
619619
],
620620
[
621-
[2,3,4,5,6],
622-
[3,4,5,6,7],
623-
[4,5,6,7,8],
624-
[5,6,7,8,9],
625-
[6,7,8,9,10]
621+
Float32Array.from([2,3,4,5,6]),
622+
Float32Array.from([3,4,5,6,7]),
623+
Float32Array.from([4,5,6,7,8]),
624+
Float32Array.from([5,6,7,8,9]),
625+
Float32Array.from([6,7,8,9,10])
626626
],
627627
[
628-
[3,4,5,6,7],
629-
[4,5,6,7,8],
630-
[5,6,7,8,9],
631-
[6,7,8,9,10],
632-
[7,8,9,10,11]
628+
Float32Array.from([3,4,5,6,7]),
629+
Float32Array.from([4,5,6,7,8]),
630+
Float32Array.from([5,6,7,8,9]),
631+
Float32Array.from([6,7,8,9,10]),
632+
Float32Array.from([7,8,9,10,11])
633633
],
634634
[
635-
[4,5,6,7,8],
636-
[5,6,7,8,9],
637-
[6,7,8,9,10],
638-
[7,8,9,10,11],
639-
[8,9,10,11,12]
635+
Float32Array.from([4,5,6,7,8]),
636+
Float32Array.from([5,6,7,8,9]),
637+
Float32Array.from([6,7,8,9,10]),
638+
Float32Array.from([7,8,9,10,11]),
639+
Float32Array.from([8,9,10,11,12])
640640
]
641641
]
642642
);

0 commit comments

Comments
 (0)