summaryrefslogtreecommitdiff
path: root/src/simulation/actions.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/simulation/actions.test.js')
-rw-r--r--src/simulation/actions.test.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/simulation/actions.test.js b/src/simulation/actions.test.js
index e0b29dc..e8406bc 100644
--- a/src/simulation/actions.test.js
+++ b/src/simulation/actions.test.js
@@ -280,3 +280,15 @@ test("take flag", () => {
expect(take_flag.propose(world, agent, [0])).toEqual([]);
});
+
+
+test("frozen agents cannot move", () => {
+ const agent = { id: 0, x: 0, y: 0, flags: { orientation: 'n', frozen: true } };
+
+ const world = { agents: [agent] };
+
+ expect(move_forward.propose(world, agent, [1])).toEqual([]);
+ expect(move_backward.propose(world, agent, [1])).toEqual([]);
+ expect(turn_left.propose(world, agent, [1])).toEqual([]);
+ expect(turn_right.propose(world, agent, [1])).toEqual([]);
+});