diff options
author | sanine <sanine.not@pm.me> | 2023-11-10 20:48:53 -0600 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2023-11-10 20:48:53 -0600 |
commit | 3b148775e5cf69882fe2503e144777b9ffd166db (patch) | |
tree | 28634a561454d31f1858c83caacda57aa4747fc4 /src/simulation/actions.test.js | |
parent | e7eb6a78e165c2103323baa9bd6cbdaf7444c17d (diff) |
add pretend_frozen action
Diffstat (limited to 'src/simulation/actions.test.js')
-rw-r--r-- | src/simulation/actions.test.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/simulation/actions.test.js b/src/simulation/actions.test.js index 1ebe9a9..43ad23c 100644 --- a/src/simulation/actions.test.js +++ b/src/simulation/actions.test.js @@ -7,6 +7,7 @@ const [ move_forward, move_backward, turn_left, turn_right, place, trigger, + pretend_frozen, ...rest ] = actions; @@ -197,3 +198,22 @@ test("trigger", () => { expect(trigger.propose(null, e, [0])).toEqual([]); expect(trigger.propose(null, w, [-1])).toEqual([]); }); + + +test("pretend frozen", () => { + const agent = { id: 2, x: 0, y: 0, flags: { orientation: 'n' } }; + + expect(pretend_frozen.propose(null, agent, [1])).toEqual([{ + agent_changes: [{ + agent_id: 2, + flags: { pretend_frozen: true }, + }] + }]); + + expect(pretend_frozen.propose(null, agent, [0])).toEqual([{ + agent_changes: [{ + agent_id: 2, + flags: { pretend_frozen: false }, + }] + }]); +}); |