diff options
Diffstat (limited to 'src/simulation/actions.test.js')
-rw-r--r-- | src/simulation/actions.test.js | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/src/simulation/actions.test.js b/src/simulation/actions.test.js index d039f8a..04111f1 100644 --- a/src/simulation/actions.test.js +++ b/src/simulation/actions.test.js @@ -16,23 +16,23 @@ test("move forward", () => { const e = { id: 0, x: 0, y: 0, flags: { orientation: 'e' } }; const w = { id: 0, x: 0, y: 0, flags: { orientation: 'w' } }; - expect(move_forward.propose(n, [1])).toEqual([ + expect(move_forward.propose(null, n, [1])).toEqual([ { agent_changes: [{ agent_id: 0, x: 0, y: -1 }] }, ]); - expect(move_forward.propose(s, [1])).toEqual([ + expect(move_forward.propose(null, s, [1])).toEqual([ { agent_changes: [{ agent_id: 0, x: 0, y: 1 }] }, ]); - expect(move_forward.propose(e, [1])).toEqual([ + expect(move_forward.propose(null, e, [1])).toEqual([ { agent_changes: [{ agent_id: 0, x: 1, y: 0 }] }, ]); - expect(move_forward.propose(w, [1])).toEqual([ + expect(move_forward.propose(null, w, [1])).toEqual([ { agent_changes: [{ agent_id: 0, x: -1, y: 0 }] }, ]); - expect(move_forward.propose(n, [0])).toEqual([]); - expect(move_forward.propose(s, [-1])).toEqual([]); - expect(move_forward.propose(e, [0])).toEqual([]); - expect(move_forward.propose(w, [-1])).toEqual([]); + expect(move_forward.propose(null, n, [0])).toEqual([]); + expect(move_forward.propose(null, s, [-1])).toEqual([]); + expect(move_forward.propose(null, e, [0])).toEqual([]); + expect(move_forward.propose(null, w, [-1])).toEqual([]); }); @@ -42,23 +42,23 @@ test("move backward", () => { const e = { id: 0, x: 0, y: 0, flags: { orientation: 'e' } }; const w = { id: 0, x: 0, y: 0, flags: { orientation: 'w' } }; - expect(move_backward.propose(n, [1])).toEqual([ + expect(move_backward.propose(null, n, [1])).toEqual([ { agent_changes: [{ agent_id: 0, x: 0, y: 1 }] }, ]); - expect(move_backward.propose(s, [1])).toEqual([ + expect(move_backward.propose(null, s, [1])).toEqual([ { agent_changes: [{ agent_id: 0, x: 0, y: -1 }] }, ]); - expect(move_backward.propose(e, [1])).toEqual([ + expect(move_backward.propose(null, e, [1])).toEqual([ { agent_changes: [{ agent_id: 0, x: -1, y: 0 }] }, ]); - expect(move_backward.propose(w, [1])).toEqual([ + expect(move_backward.propose(null, w, [1])).toEqual([ { agent_changes: [{ agent_id: 0, x: 1, y: 0 }] }, ]); - expect(move_backward.propose(n, [0])).toEqual([]); - expect(move_backward.propose(s, [-1])).toEqual([]); - expect(move_backward.propose(e, [0])).toEqual([]); - expect(move_backward.propose(w, [-1])).toEqual([]); + expect(move_backward.propose(null, n, [0])).toEqual([]); + expect(move_backward.propose(null, s, [-1])).toEqual([]); + expect(move_backward.propose(null, e, [0])).toEqual([]); + expect(move_backward.propose(null, w, [-1])).toEqual([]); }); @@ -68,23 +68,23 @@ test("turn_left", () => { const e = { id: 0, x: 0, y: 0, flags: { orientation: 'e' } }; const w = { id: 0, x: 0, y: 0, flags: { orientation: 'w' } }; - expect(turn_left.propose(n, [1])).toEqual([ + expect(turn_left.propose(null, n, [1])).toEqual([ { agent_changes: [{ agent_id: 0, flags: { orientation: 'w' } }] }, ]); - expect(turn_left.propose(s, [1])).toEqual([ + expect(turn_left.propose(null, s, [1])).toEqual([ { agent_changes: [{ agent_id: 0, flags: { orientation: 'e' } }] }, ]); - expect(turn_left.propose(e, [1])).toEqual([ + expect(turn_left.propose(null, e, [1])).toEqual([ { agent_changes: [{ agent_id: 0, flags: { orientation: 'n' } }] }, ]); - expect(turn_left.propose(w, [1])).toEqual([ + expect(turn_left.propose(null, w, [1])).toEqual([ { agent_changes: [{ agent_id: 0, flags: { orientation: 's' } }] }, ]); - expect(turn_left.propose(n, [0])).toEqual([]); - expect(turn_left.propose(s, [-1])).toEqual([]); - expect(turn_left.propose(e, [0])).toEqual([]); - expect(turn_left.propose(w, [-1])).toEqual([]); + expect(turn_left.propose(null, n, [0])).toEqual([]); + expect(turn_left.propose(null, s, [-1])).toEqual([]); + expect(turn_left.propose(null, e, [0])).toEqual([]); + expect(turn_left.propose(null, w, [-1])).toEqual([]); }); @@ -94,23 +94,23 @@ test("turn_right", () => { const e = { id: 0, x: 0, y: 0, flags: { orientation: 'e' } }; const w = { id: 0, x: 0, y: 0, flags: { orientation: 'w' } }; - expect(turn_right.propose(n, [1])).toEqual([ + expect(turn_right.propose(null, n, [1])).toEqual([ { agent_changes: [{ agent_id: 0, flags: { orientation: 'e' } }] }, ]); - expect(turn_right.propose(s, [1])).toEqual([ + expect(turn_right.propose(null, s, [1])).toEqual([ { agent_changes: [{ agent_id: 0, flags: { orientation: 'w' } }] }, ]); - expect(turn_right.propose(e, [1])).toEqual([ + expect(turn_right.propose(null, e, [1])).toEqual([ { agent_changes: [{ agent_id: 0, flags: { orientation: 's' } }] }, ]); - expect(turn_right.propose(w, [1])).toEqual([ + expect(turn_right.propose(null, w, [1])).toEqual([ { agent_changes: [{ agent_id: 0, flags: { orientation: 'n' } }] }, ]); - expect(turn_right.propose(n, [0])).toEqual([]); - expect(turn_right.propose(s, [-1])).toEqual([]); - expect(turn_right.propose(e, [0])).toEqual([]); - expect(turn_right.propose(w, [-1])).toEqual([]); + expect(turn_right.propose(null, n, [0])).toEqual([]); + expect(turn_right.propose(null, s, [-1])).toEqual([]); + expect(turn_right.propose(null, e, [0])).toEqual([]); + expect(turn_right.propose(null, w, [-1])).toEqual([]); }); |