From 48d487e0e94e2b3dbded3af2bb49e53fe9631a49 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Wed, 13 May 2026 16:54:00 +0200 Subject: [PATCH] Update spline corridor junction mesh test assertions for robustness --- .../spline-corridor-junction-mesh.test.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/geometry/spline-corridor-junction-mesh.test.ts b/tests/geometry/spline-corridor-junction-mesh.test.ts index 6e94b3af..6761ee8a 100644 --- a/tests/geometry/spline-corridor-junction-mesh.test.ts +++ b/tests/geometry/spline-corridor-junction-mesh.test.ts @@ -202,20 +202,26 @@ describe("spline corridor junction mesh generation", () => { expect(meshData?.profileVertexCount).toBe(4); expect(meshData?.positions).toHaveLength((8 + 1) * 4 * 3); expect(meshData?.indices).toHaveLength(8 * 3 * 6); - expect(Array.from(meshData!.positions.slice(0, 12))).toEqual([ + const firstProfile = Array.from(meshData!.positions.slice(0, 12)); + + expect(firstProfile).toEqual([ 3, expect.closeTo(0.1, 5), -1, 3, expect.closeTo(0.3, 5), -1, - expect.not.closeTo(3, 5), + firstProfile[6], expect.closeTo(0.3, 5), - expect.not.closeTo(-1, 5), - expect.not.closeTo(3, 5), + firstProfile[8], + firstProfile[9], expect.closeTo(0.1, 5), - expect.not.closeTo(-1, 5) + firstProfile[11] ]); + expect(firstProfile[6]).not.toBeCloseTo(3); + expect(firstProfile[8]).not.toBeCloseTo(-1); + expect(firstProfile[9]).not.toBeCloseTo(3); + expect(firstProfile[11]).not.toBeCloseTo(-1); }); it("samples full terrain influence inside the connection footprint and falloff outside it", () => {