summaryrefslogtreecommitdiff
path: root/src/simulation/senses.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/simulation/senses.test.js')
-rw-r--r--src/simulation/senses.test.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/simulation/senses.test.js b/src/simulation/senses.test.js
new file mode 100644
index 0000000..1caed52
--- /dev/null
+++ b/src/simulation/senses.test.js
@@ -0,0 +1,18 @@
+'use strict';
+
+import { senses } from './senses.js';
+
+const [ frozen, ...rest ] = senses;
+
+
+test("frozen sense", () => {
+ const agent = {
+ id: 0, x: 0, y: 0,
+ flags: { frozen: true, },
+ };
+ const lattice = null;
+
+ expect(frozen.read(lattice, agent)).toEqual([1]);
+ agent.flags.frozen = false;
+ expect(frozen.read(lattice, agent)).toEqual([0]);
+});