This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade to Math::BigInt 1.54.
[perl5.git] / lib / Math / BigInt / t / config.t
1 #!/usr/bin/perl -w
2
3 use strict;
4 use Test;
5
6 BEGIN
7   {
8   $| = 1;
9   chdir 't' if -d 't';
10   unshift @INC, '../lib'; # for running manually
11   plan tests => 10;
12   } 
13
14 # test whether Math::BigInt constant works
15
16 use Math::BigInt;
17
18 ok (Math::BigInt->can('config'));
19
20 my $cfg = Math::BigInt->config();
21
22 ok (ref($cfg),'HASH');
23
24 ok ($cfg->{lib},'Math::BigInt::Calc');
25 ok ($cfg->{lib_version},'0.25');
26 ok ($cfg->{class},'Math::BigInt');
27 ok ($cfg->{upgrade}||'','');
28 ok ($cfg->{div_scale},40);
29
30 ok ($cfg->{precision}||0,0);    # should test for undef
31 ok ($cfg->{accuracy}||0,0);
32
33 ok ($cfg->{round_mode},'even');
34
35 # all tests done
36