This commit is contained in:
Nicholas Butzke
2026-08-02 02:20:02 -04:00
parent 61669627db
commit 922983429e
226 changed files with 34032 additions and 18521 deletions
+15
View File
@@ -33,6 +33,7 @@ func run_all() -> void:
var tests := [
"test_states_register_and_initialize",
"test_do_jump_sets_velocity_and_counters",
"test_double_jump_emits_jet_event",
"test_wall_run_preserves_fast_entry_speed",
"test_wall_run_entry_keeps_some_upward_momentum",
"test_dash_cooldown_is_per_machine",
@@ -127,6 +128,20 @@ func test_do_jump_sets_velocity_and_counters() -> void:
_expect(not sm.on_ground, "no longer grounded")
func test_double_jump_emits_jet_event() -> void:
var events := []
sm.movement_event.connect(func(ev, data): events.append([ev, data]))
sm.switch_to("air")
sm.current_jump_count = 1
sm.jump_cooldown_timer = 0.0
sm.input_jump_just_pressed = true
sm.states["air"].update(0.016)
_expect(fake_player.velocity.y == params.double_jump_velocity,
"double jump sets its own vertical impulse")
_expect(events.any(func(item): return item[0] == "double_jump"),
"double jump emits the replicated jet event")
func test_wall_run_preserves_fast_entry_speed() -> void:
# Enter a wall run at 20 m/s along the wall; speed must not drop to base.
sm.wall_normal = Vector3.RIGHT