From f78493e192daf4639b91352909e4029b9970fcdb Mon Sep 17 00:00:00 2001 From: sanine Date: Wed, 8 Nov 2023 00:47:06 -0600 Subject: implement basic sensing & refactor world/cells -> lattice --- src/world/proposal.test.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/world/proposal.test.js') diff --git a/src/world/proposal.test.js b/src/world/proposal.test.js index a1e1203..2f870e6 100644 --- a/src/world/proposal.test.js +++ b/src/world/proposal.test.js @@ -7,10 +7,10 @@ import { test("proposals changing different tiles don't conflict", () => { const a = { - world_changes: [{ x: 4, y: 3, from: 'empty', to: 'mutable' }], + lattice_changes: [{ x: 4, y: 3, from: 'empty', to: 'mutable' }], }; const b = { - world_changes: [{ x: 4, y: 4, from: 'empty', to: 'flag' }], + lattice_changes: [{ x: 4, y: 4, from: 'empty', to: 'flag' }], }; expect(proposal_merge([a], b)).toEqual([a, b]); @@ -19,10 +19,10 @@ test("proposals changing different tiles don't conflict", () => { test("proposals changing the same tile to different states conflict", () => { const a = { - world_changes: [{ x: 4, y: 3, from: 'empty', to: 'mutable' }], + lattice_changes: [{ x: 4, y: 3, from: 'empty', to: 'mutable' }], }; const b = { - world_changes: [{ x: 4, y: 3, from: 'empty', to: 'flag' }], + lattice_changes: [{ x: 4, y: 3, from: 'empty', to: 'flag' }], }; expect(proposal_merge([a], b)).toEqual([]); @@ -31,10 +31,10 @@ test("proposals changing the same tile to different states conflict", () => { test("proposals changing the same tile to the same state merge to a single proposal", () => { const a = { - world_changes: [{ x: 4, y: 3, from: 'empty', to: 'mutable' }], + lattice_changes: [{ x: 4, y: 3, from: 'empty', to: 'mutable' }], }; const b = { - world_changes: [{ x: 4, y: 3, from: 'empty', to: 'mutable' }], + lattice_changes: [{ x: 4, y: 3, from: 'empty', to: 'mutable' }], }; expect(proposal_merge([a], b)).toEqual([a]); @@ -43,10 +43,10 @@ test("proposals changing the same tile to the same state merge to a single propo test("proposals with identical tile updates but incompatible tile flags conflict", () => { const a = { - world_changes: [{ x: 4, y: 3, from: 'empty', to: 'mutable', flags: { v: 'a' } }], + lattice_changes: [{ x: 4, y: 3, from: 'empty', to: 'mutable', flags: { v: 'a' } }], }; const b = { - world_changes: [{ x: 4, y: 3, from: 'empty', to: 'mutable', flags: { v: 'b' } }], + lattice_changes: [{ x: 4, y: 3, from: 'empty', to: 'mutable', flags: { v: 'b' } }], }; expect(proposal_merge([a], b)).toEqual([]); @@ -55,10 +55,10 @@ test("proposals with identical tile updates but incompatible tile flags conflict test("proposals with identical tile updates but compatible tile flags do not conflict", () => { const a = { - world_changes: [{ x: 4, y: 3, from: 'empty', to: 'mutable', flags: { v: 'a', r: 'd' } }], + lattice_changes: [{ x: 4, y: 3, from: 'empty', to: 'mutable', flags: { v: 'a', r: 'd' } }], }; const b = { - world_changes: [{ x: 4, y: 3, from: 'empty', to: 'mutable', flags: { v: 'a', u: 'b' } }], + lattice_changes: [{ x: 4, y: 3, from: 'empty', to: 'mutable', flags: { v: 'a', u: 'b' } }], }; expect(proposal_merge([a], b)).toEqual([a, b]); -- cgit v1.2.1