From 24389bbc63d1017fcb451b5b66ee0cd446eb8663 Mon Sep 17 00:00:00 2001 From: codegirl-007 Date: Sat, 27 Jun 2026 23:33:23 -0700 Subject: [PATCH] fix test post-revert --- game/wave_test.odin | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/game/wave_test.odin b/game/wave_test.odin index e8601c3..d8a9263 100644 --- a/game/wave_test.odin +++ b/game/wave_test.odin @@ -7,12 +7,12 @@ test_start_wave_enters_combat :: proc(t: ^testing.T) { world := World { phase = .Combat, } - world.wave.current_wave = 0 + world.wave = 0 start_wave(&world) testing.expect(t, world.phase == .Combat) - testing.expect(t, world.wave.current_wave == 0) + testing.expect(t, world.wave == 0) } @(test) @@ -20,24 +20,26 @@ test_start_wave_from_build :: proc(t: ^testing.T) { world := World { phase = .Build, } - world.wave.current_wave = 0 + world.wave = 0 start_wave(&world) + defer delete(world.spawner.recipe) testing.expect(t, world.phase == .Combat) - testing.expect(t, world.wave.current_wave == 1) - testing.expect(t, world.wave.spawner.spawn_timer == 0) - testing.expect(t, world.wave.spawner.spawn_interval == 0.55) - testing.expect(t, world.wave.spawner.recipe_index == 0) + testing.expect(t, world.wave == 1) + testing.expect(t, world.spawner.spawn_timer == 0) + testing.expect(t, world.spawner.spawn_interval == 0.55) + testing.expect(t, world.spawner.recipe_index == 0) } @(test) test_clear_wave_not_cleared :: proc(t: ^testing.T) { world := World{} - world.wave.spawner.recipe = make([dynamic]Wave_Entry, context.allocator) - append(&world.wave.spawner.recipe, Wave_Entry{}) - defer delete(world.wave.spawner.recipe); world.wave.spawner.recipe_index = 0 - world.wave.spawner.entry_remaining = 0 + world.spawner.recipe = make([dynamic]Wave_Entry, context.allocator) + append(&world.spawner.recipe, Wave_Entry{}) + defer delete(world.spawner.recipe) + world.spawner.recipe_index = 0 + world.spawner.entry_remaining = 0 result := clear_wave(&world) @@ -47,13 +49,13 @@ test_clear_wave_not_cleared :: proc(t: ^testing.T) { @(test) test_clear_wave_cleared :: proc(t: ^testing.T) { world := World{} - world.wave.spawner.recipe = make([dynamic]Wave_Entry, context.allocator) - append(&world.wave.spawner.recipe, Wave_Entry{}) - defer delete(world.wave.spawner.recipe); world.wave.spawner.recipe_index = 1 - world.wave.spawner.entry_remaining = 0 + world.spawner.recipe = make([dynamic]Wave_Entry, context.allocator) + append(&world.spawner.recipe, Wave_Entry{}) + defer delete(world.spawner.recipe) + world.spawner.recipe_index = 1 + world.spawner.entry_remaining = 0 result := clear_wave(&world) testing.expect(t, result == true) } -