From 6edf5d671c7067ff8faa5236887b829be5f165ca Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Fri, 20 Nov 2026 02:11:46 +0100 Subject: [PATCH] SoA grab tests: an anchor reaches its target within the very next step Kills the mutant that stretched the target time step. Co-Authored-By: Claude Sonnet 5.5 --- tests/Ymir.Box3D.Soa.Tests/Box3DSoaGrabTests.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/Ymir.Box3D.Soa.Tests/Box3DSoaGrabTests.cs b/tests/Ymir.Box3D.Soa.Tests/Box3DSoaGrabTests.cs index 4a64904..fc887f7 100644 --- a/tests/Ymir.Box3D.Soa.Tests/Box3DSoaGrabTests.cs +++ b/tests/Ymir.Box3D.Soa.Tests/Box3DSoaGrabTests.cs @@ -48,6 +48,18 @@ public sealed class Box3DSoaGrabTests Assert.Equal(0f, view.Size0[anchor]); // no shape, so no size } + [Fact] + public void An_anchor_reaches_its_target_at_the_end_of_the_very_next_step() + { + using var world = new Box3DSoaWorld(capacity: 1, gravityY: 0f); + var anchor = world.AddAnchor(1, (0f, 0f, 0f)); + var view = world.View; + world.SetAnchorTarget(anchor, (1f, 2f, 0f), default, Dt); + world.Step(Dt); + Assert.Equal(1f, view.PositionX[anchor], 1e-3f); + Assert.Equal(2f, view.PositionY[anchor], 1e-3f); + } + [Fact] public void The_angular_spring_turns_the_grabbed_body_to_the_anchors_rotation_and_off_leaves_it_free() {