diff options
author | sanine <sanine.not@pm.me> | 2023-11-16 14:50:00 -0600 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2023-11-16 14:50:00 -0600 |
commit | f9fc4d26ec5fca9ee175c8a6fbcdd0fa36f10947 (patch) | |
tree | f190e6e465bb563c608a916f41fc8bf686ea2897 /src/world/sense.test.js | |
parent | 7825b92ce3be95a0ce1dfea9388adbaadce83b1f (diff) |
clear out js files
Diffstat (limited to 'src/world/sense.test.js')
-rw-r--r-- | src/world/sense.test.js | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/world/sense.test.js b/src/world/sense.test.js deleted file mode 100644 index 27ee2b5..0000000 --- a/src/world/sense.test.js +++ /dev/null @@ -1,33 +0,0 @@ -import { sense_read } from './sense.js'; - - -test("basic sense works", () => { - const flag_sense = { - size: 1, - read: (world, agent) => { - const {x, y} = agent; - return [ world.lattice[y-1][x].type === 'flag' ? 1.0 : 0.0 ] - }, - }; - - const lattice = [[ { type: 'flag' } ]]; - const agent = { x: 0, y: 1 }; - - expect(sense_read({lattice}, agent, flag_sense)).toEqual([1.0]); -}); - - -test("senses throw if the size is incorrect", () => { - const flag_sense = { - size: 2, - read: (world, agent) => { - const {x, y} = agent; - return [ world.lattice[y-1][x].type === 'flag' ? 1.0 : 0.0 ] - }, - } - - const lattice = [[ { type: 'flag' } ]]; - const agent = { x: 0, y: 1 }; - - expect(() => sense_read({lattice}, agent, flag_sense)).toThrow(); -}); |