summaryrefslogtreecommitdiff
path: root/ext/bignum/t/ratopt_a.t
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bignum/t/ratopt_a.t')
-rw-r--r--ext/bignum/t/ratopt_a.t34
1 files changed, 34 insertions, 0 deletions
diff --git a/ext/bignum/t/ratopt_a.t b/ext/bignum/t/ratopt_a.t
new file mode 100644
index 0000000000..f004afe428
--- /dev/null
+++ b/ext/bignum/t/ratopt_a.t
@@ -0,0 +1,34 @@
+#!/usr/bin/perl -w
+
+###############################################################################
+
+use Test::More;
+use strict;
+
+BEGIN
+ {
+ $| = 1;
+ chdir 't' if -d 't';
+ unshift @INC, '../lib';
+ plan tests => 7;
+ }
+
+my @C = qw/Math::BigInt Math::BigFloat Math::BigRat/;
+
+# bigrat (bug until v0.15)
+use bigrat a => 2;
+
+foreach my $c (@C)
+ {
+ is ($c->accuracy(), 2, "$c accuracy = 2");
+ }
+
+eval { bigrat->import( accuracy => '42') };
+
+is ($@, '', 'no error');
+
+foreach my $c (@C)
+ {
+ is ($c->accuracy(), 42, "$c accuracy = 42");
+ }
+