From d6c0a0830d6c61ea7c88ab6dff8189904ade4578 Mon Sep 17 00:00:00 2001 From: sanine Date: Thu, 9 Nov 2023 16:58:08 -0600 Subject: add beehive test --- src/simulation/lattice_rules.test.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src') diff --git a/src/simulation/lattice_rules.test.js b/src/simulation/lattice_rules.test.js index 681b721..9a6a344 100644 --- a/src/simulation/lattice_rules.test.js +++ b/src/simulation/lattice_rules.test.js @@ -81,3 +81,20 @@ test("glider", () => { [ D, D, D, D, D, D ], ]); }); + + +test("beehive", () => { + const L = { type: 'active', flags: {} }; + const D = { type: 'empty', flags: {} }; + const lattice = [ + [ D, D, D, D, D, D ], + [ D, D, L, L, D, D ], + [ D, L, D, D, L, D ], + [ D, D, L, L, D, D ], + [ D, D, D, D, D, D ], + ]; + + const world = { lattice, lattice_rules, agents: [], senses: [], actions: [] }; + //expect(world_update(world).lattice).toEqual([ + expect(apply(world_update, 1, world).lattice).toEqual(lattice); +}); -- cgit v1.2.1