diff options
author | sanine <sanine.not@pm.me> | 2023-11-11 15:04:36 -0600 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2023-11-11 15:04:36 -0600 |
commit | f7b0ed22b2fd0ddafc4a84dde1ad8e3208144844 (patch) | |
tree | e290cda13f58eb9a2e3cf2e5e7b05748a0c8e982 /src/world/lattice.test.js | |
parent | c2466a35fb1edce6088b72df17444631f7034e07 (diff) |
gol changes make sound
Diffstat (limited to 'src/world/lattice.test.js')
-rw-r--r-- | src/world/lattice.test.js | 61 |
1 files changed, 32 insertions, 29 deletions
diff --git a/src/world/lattice.test.js b/src/world/lattice.test.js index c2fdb6b..d1bdd13 100644 --- a/src/world/lattice.test.js +++ b/src/world/lattice.test.js @@ -77,32 +77,35 @@ test("check proposals agains lattice for validity", () => { }); -test("proposals update cell flags appropriately", () => { - const lattice = [ - [ - { type: 'empty', flags: { step: 1} }, - { type: 'empty', flags: {} }, - { type: 'plant', flags: { foo: 'bar' } }, - ] - ]; - - // flags are reset each time step - expect(lattice_apply(lattice, [{ world_updates:[{ x: 1, y: 0, from: 'empty', to: 'plant' }]}])).toEqual([[ - { type: 'empty', flags: {} }, - { type: 'plant', flags: {} }, - { type: 'plant', flags: {} }, - ]]); - - // flags are combined when updating - expect(lattice_apply(lattice, [ - { world_updates: [{ x: 1, y: 0, flags: { foo: 'bar' } } ]}, - { world_updates: [{ x: 1, y: 0, from: 'empty', to: 'plant', flags: { baz: 'baz' } } ]}, - { world_updates: [{ x: 0, y: 0, from: 'empty', to: 'plant', flags: { foo: 'foo' } } ]}, - { world_updates: [{ x: 0, y: 0, flags: { beep: 'boop' } } ]}, - ])).toEqual([[ - { type: 'plant', flags: { foo: 'foo', beep: 'boop' } }, - { type: 'plant', flags: { foo: 'bar', baz: 'baz' } }, - { type: 'plant', flags: {} }, - ]]); - -}); +// this test is no longer relevant because resetting the cell flags is taken care of by world_update, +// not lattice_apply +// +//test("proposals update cell flags appropriately", () => { +// const lattice = [ +// [ +// { type: 'empty', flags: { step: 1} }, +// { type: 'empty', flags: {} }, +// { type: 'plant', flags: { foo: 'bar' } }, +// ] +// ]; +// +// // flags are reset each time step +// expect(lattice_apply(lattice, [{ world_updates:[{ x: 1, y: 0, from: 'empty', to: 'plant' }]}])).toEqual([[ +// { type: 'empty', flags: {} }, +// { type: 'plant', flags: {} }, +// { type: 'plant', flags: {} }, +// ]]); +// +// // flags are combined when updating +// expect(lattice_apply(lattice, [ +// { world_updates: [{ x: 1, y: 0, flags: { foo: 'bar' } } ]}, +// { world_updates: [{ x: 1, y: 0, from: 'empty', to: 'plant', flags: { baz: 'baz' } } ]}, +// { world_updates: [{ x: 0, y: 0, from: 'empty', to: 'plant', flags: { foo: 'foo' } } ]}, +// { world_updates: [{ x: 0, y: 0, flags: { beep: 'boop' } } ]}, +// ])).toEqual([[ +// { type: 'plant', flags: { foo: 'foo', beep: 'boop' } }, +// { type: 'plant', flags: { foo: 'bar', baz: 'baz' } }, +// { type: 'plant', flags: {} }, +// ]]); +// +//}); |