Commit | Line | Data |
---|---|---|
b68b7ab1 T |
1 | #!/usr/bin/perl -w |
2 | ||
b68b7ab1 | 3 | use strict; |
4aa37faf | 4 | use Test::More tests => 4; |
b68b7ab1 | 5 | |
4aa37faf | 6 | BEGIN { unshift @INC, 't'; } |
b68b7ab1 T |
7 | |
8 | # first load BigInt with Calc | |
9 | use Math::BigInt lib => 'Calc'; | |
10 | ||
11 | # BigFloat will remember that we loaded Calc | |
12 | require Math::BigFloat; | |
13 | is (Math::BigFloat::config()->{lib}, 'Math::BigInt::Calc', 'BigFloat got Calc'); | |
14 | ||
15 | # now load BigInt again with a different lib | |
16 | Math::BigInt->import( lib => 'BareCalc' ); | |
17 | ||
18 | # and finally test that BigFloat knows about BareCalc | |
19 | ||
20 | is (Math::BigFloat::config()->{lib}, 'Math::BigInt::BareCalc', 'BigFloat was notified'); | |
21 | ||
50109ad0 RGS |
22 | # See that Math::BigFloat supports "only" |
23 | eval "Math::BigFloat->import('only' => 'Calc')"; | |
24 | is (Math::BigFloat::config()->{lib}, 'Math::BigInt::Calc', '"only" worked'); | |
25 | ||
26 | # See that Math::BigFloat supports "try" | |
27 | eval "Math::BigFloat->import('try' => 'BareCalc')"; | |
28 | is (Math::BigFloat::config()->{lib}, 'Math::BigInt::BareCalc', '"try" worked'); | |
29 |