summaryrefslogtreecommitdiff
path: root/t/lib
diff options
context:
space:
mode:
Diffstat (limited to 't/lib')
-rwxr-xr-xt/lib/complex.t34
1 files changed, 33 insertions, 1 deletions
diff --git a/t/lib/complex.t b/t/lib/complex.t
index 46114fbf5b..310e6f5e3c 100755
--- a/t/lib/complex.t
+++ b/t/lib/complex.t
@@ -4,7 +4,7 @@
#
# Regression tests for the Math::Complex pacakge
# -- Raphael Manfredi, September 1996
-# -- Jarkko Hietaniemi, March 1997
+# -- Jarkko Hietaniemi, March-April 1997
BEGIN {
chdir 't' if -d 't';
@@ -49,6 +49,38 @@ while (<DATA>) {
}
}
+# test the divbyzeros
+
+test_dbz(
+ 'i/0',
+# 'tan(pi/2)', # may succeed thanks to floating point inaccuracies
+# 'sec(pi/2)', # may succeed thanks to floating point inaccuracies
+ 'csc(0)',
+ 'cot(0)',
+ 'atan(i)',
+ 'asec(0)',
+ 'acsc(0)',
+ 'acot(i)',
+# 'tanh(pi/2)', # may succeed thanks to floating point inaccuracies
+# 'sech(pi/2)', # may succeed thanks to floating point inaccuracies
+ 'csch(0)',
+ 'coth(0)',
+ 'atanh(1)',
+ 'asech(0)',
+ 'acsch(0)',
+ 'acoth(1)'
+ );
+
+sub test_dbz {
+ for my $op (@_) {
+ $test++;
+
+ push(@script, qq(eval '$op';));
+ push(@script, qq(print 'not ' unless (\$@ =~ /Division by zero/);));
+ push(@script, qq(print "ok $test\n";));
+ }
+}
+
print "1..$test\n";
eval join '', @script;
die $@ if $@;