some other tests
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 20s
Create tag and build when new code gets to main / Export (push) Successful in 5m5s

This commit is contained in:
2026-02-23 15:22:57 +01:00
parent a4873f183c
commit de41bbeb8d
5 changed files with 109 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
using System.Threading.Tasks;
using Godot;
using GodotStateCharts;
namespace Movementtests.tests;
@@ -44,7 +45,7 @@ public class PlayerMovementTest
var startPos = _player.GlobalPosition;
_runner.SimulateKeyPress(Key.W);
await _runner.AwaitMillis(300);
await _runner.AwaitMillis(100);
_runner.SimulateKeyRelease(Key.W);
var endPos = _player.GlobalPosition;
@@ -63,17 +64,24 @@ public class PlayerMovementTest
var startPos = _player.GlobalPosition;
_runner.SimulateKeyPress(Key.Space);
await _runner.AwaitMillis(100);
_runner.SimulateKeyRelease(Key.Space);
await _runner.AwaitIdleFrame();
var jumping = StateChartState.Of(_player.GetNode("StateChart/Root/Movement/Jump"));
AssertBool(jumping.Active).IsTrue();
_runner.SimulateKeyRelease(Key.Space);
await _runner.AwaitIdleFrame();
var endPos = _player.GlobalPosition;
var direction = startPos.DirectionTo(endPos);
AssertVector(direction).IsEqualApprox(Vector3.Up, _vectorTolerance);
AssertVector(_player.Velocity.Normalized()).IsEqualApprox(Vector3.Up, _vectorTolerance);
await _runner.AwaitMillis(500);
await _runner.AwaitMillis(600);
endPos = _player.GlobalPosition;
AssertVector(endPos - startPos).IsEqualApprox(Vector3.Zero, _vectorTolerance);
var grounded = StateChartState.Of(_player.GetNode("StateChart/Root/Movement/Grounded"));
AssertBool(grounded.Active).IsTrue();
}
[TestCase("MantleLocation1")]
@@ -88,6 +96,9 @@ public class PlayerMovementTest
_runner.SimulateKeyPress(Key.Space);
await _runner.AwaitMillis(100);
var mantling = StateChartState.Of(_player.GetNode("StateChart/Root/Movement/Mantling"));
AssertBool(mantling.Active).IsTrue();
_runner.SimulateKeyRelease(Key.Space);
await _runner.AwaitMillis(500);