summaryrefslogtreecommitdiff
path: root/src/simulation/senses.test.js
blob: 1caed52c4e31ccf47834c43102e5e977d0fbaaca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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]);
});