4
use Test::More tests => 7;
5
BEGIN { use_ok('aggregate') }
6
require_ok('aggregate');
8
# adapted from ../java/aggregate_runme.java
10
# Confirm that move() returns correct results under normal use
11
is(aggregate::move($aggregate::UP), $aggregate::UP, "UP");
13
is(aggregate::move($aggregate::DOWN), $aggregate::DOWN, "DOWN");
15
is(aggregate::move($aggregate::LEFT), $aggregate::LEFT, "LEFT");
17
is(aggregate::move($aggregate::RIGHT), $aggregate::RIGHT, "RIGHT");
19
# Confirm that move() raises an exception when the contract is violated
20
eval { aggregate::move(0) };
21
like($@, qr/\bRuntimeError\b/);