# File: AngularDifference.t
use AngularDifference; # provides angdiff
use Test::More tests => 6;
# identical angles should have a diff of zero
is( angdiff( 0, 0), # observed result
0, # expected result
"zero at 0" # name of the test case
); # case 1
is( angdiff( 90, 90), 0, "zero at 90" ); # case 2
# order of angles shouldn't matter to diff
is( angdiff( 0, 45), 45, "0,45 -> 45" ); # case 3
is( angdiff( 45, 0), 45, "45,0 -> 45" ); # case 4
# should return the smallest angle between
is( angdiff( 0,270), 90, "0,270 -> 90, not 270" ); # case 5
# multiples of 360-degrees shouldn't matter
my ($a,$b) = (360 * 2, 360 * 4);
is( angdiff($a,$b+23),23, "$a,$b+23 -> 23" ); # case 6