Skip to content

Commit

Permalink
add tests for events
Browse files Browse the repository at this point in the history
  • Loading branch information
jespertheend committed Oct 31, 2024
1 parent 7df7eba commit cceb3d8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
5 changes: 5 additions & 0 deletions test/unit/src/math/Vec2.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,11 @@ Deno.test({
vec.subVector(new Vec2(0, 1));
expectedResult.push(0x01);

vec.set(0, 0);
vec.lerp([0, 1], 0.5);
expectedResult.push(0x11);
expectedResult.push(0x01);

// vec.cross(1, 2, 3);
// expectedResult.push(0x11);

Expand Down
7 changes: 7 additions & 0 deletions test/unit/src/math/Vec3.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1090,8 +1090,15 @@ Deno.test({
vec.subVector(new Vec3(0, 1, 0));
expectedResult.push(0x010);

vec.set(0, 0, 0);
vec.lerp([0, 1, 1], 0.5);
expectedResult.push(0x111);
expectedResult.push(0x011);

vec.set(2.5, 8.5, 8.5);
vec.cross(1, 2, 3);
expectedResult.push(0x111);
expectedResult.push(0x111);

vec.set(1, 2, 3);
vec.projectOnVector(3, 2, 1);
Expand Down
6 changes: 4 additions & 2 deletions test/unit/src/math/Vec4.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -989,8 +989,10 @@ Deno.test({
vec.subVector(new Vec4(0, 1, 0, 0));
expectedResult.push(0x0100);

// vec.cross(1, 2, 3, 4);
// expectedResult.push(0x1111);
vec.set(0, 0, 0, 0);
vec.lerp([0, 1, 1, 0], 0.5);
expectedResult.push(0x1111);
expectedResult.push(0x0110);

vec.set(1, 2, 3, 4);
vec.projectOnVector(4, 3, 2, 1);
Expand Down

0 comments on commit cceb3d8

Please sign in to comment.