extends TestCase ## N8 (#39): the soak's scripted client must not keep a finished match's island alive, ## and the live counts the soak's leak check reads must follow islands as they come and go. func test_soak_player_lets_go_of_the_last_island() -> void: var before: int = LiveCount.of(&"Simulation") var player: SoakPlayer = SoakPlayer.new(3) var world: Simulation = Simulation.new(4, SimGround.flat(2.0)) assert_eq(LiveCount.of(&"Simulation"), before + 1) var me: SimEntity = world.entities.find(world.add_player()) assert_not_null(player.command(10, me, world)) me = null world = null assert_eq(LiveCount.of(&"Simulation"), before, "the player held on to the island") func test_soak_player_finds_the_top_again_on_a_new_island() -> void: var player: SoakPlayer = SoakPlayer.new(0) var low: Simulation = Simulation.new(4, SimGround.flat(2.0)) player.command(1, low.entities.find(low.add_player()), low) var first: Vector2 = player.get("_top") var other: Simulation = Simulation.new(5) player.command(2, other.entities.find(other.add_player()), other) assert_ne(player.get("_top"), first, "a new seed, a new high point") func test_grounds_are_counted_while_alive() -> void: var before: int = LiveCount.of(&"SimGround") var held: Array[SimGround] = [SimGround.flat(1.0)] assert_eq(LiveCount.of(&"SimGround"), before + 1) held.clear() assert_eq(LiveCount.of(&"SimGround"), before)