Subject: | Unit test fails sometimes |
The test suite has random inputs. Some inputs tickle a bug in the test suite that cause a failure. In particular, the "Quaternions can be raised to integer exponents" test fails if $exponent is 0. The attached patch fixes it.
Subject: | math-quaternion-testsuite.patch |
diff --git a/t/001_basic.t b/t/001_basic.t
index 1a6d522..5a40f1b 100644
--- a/t/001_basic.t
+++ b/t/001_basic.t
@@ -221,8 +221,8 @@ ok( quatequal_fuzz(
"The inverse of a unit quaternion is its conjugate");
my $exponent = int rand 100;
-my $q1manual = $q1;
-for (1..($exponent-1)) { $q1manual = Math::Quaternion::multiply($q1,$q1manual); }
+my $q1manual = [1,0,0,0];
+for (1..$exponent) { $q1manual = Math::Quaternion::multiply($q1,$q1manual); }
my $q1expon = Math::Quaternion::power($q1,$exponent);
ok( quatequal_fuzz($q1manual,$q1expon),