diff options
author | sanine <sanine.not@pm.me> | 2023-11-08 00:47:06 -0600 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2023-11-08 00:47:06 -0600 |
commit | f78493e192daf4639b91352909e4029b9970fcdb (patch) | |
tree | 5b43952cc5da05ffcc942d079f0c3b60674060be /src/world/proposal.test.js | |
parent | 3ae8f476f3865982ca69d0e39b05b5aa8ec43694 (diff) |
implement basic sensing & refactor world/cells -> lattice
Diffstat (limited to 'src/world/proposal.test.js')
-rw-r--r-- | src/world/proposal.test.js | 20 |
1 files changed, 10 insertions, 10 deletions
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]); |