This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Document string- and number-specific bitops in perlop
[perl5.git] / dist / Math-BigInt / t / lib_load.t
CommitLineData
b68b7ab1
T
1#!/usr/bin/perl -w
2
b68b7ab1 3use strict;
4aa37faf 4use Test::More tests => 4;
b68b7ab1 5
4aa37faf 6BEGIN { unshift @INC, 't'; }
b68b7ab1
T
7
8# first load BigInt with Calc
9use Math::BigInt lib => 'Calc';
10
11# BigFloat will remember that we loaded Calc
12require Math::BigFloat;
13is (Math::BigFloat::config()->{lib}, 'Math::BigInt::Calc', 'BigFloat got Calc');
14
15# now load BigInt again with a different lib
16Math::BigInt->import( lib => 'BareCalc' );
17
18# and finally test that BigFloat knows about BareCalc
19
20is (Math::BigFloat::config()->{lib}, 'Math::BigInt::BareCalc', 'BigFloat was notified');
21
50109ad0
RGS
22# See that Math::BigFloat supports "only"
23eval "Math::BigFloat->import('only' => 'Calc')";
24is (Math::BigFloat::config()->{lib}, 'Math::BigInt::Calc', '"only" worked');
25
26# See that Math::BigFloat supports "try"
27eval "Math::BigFloat->import('try' => 'BareCalc')";
28is (Math::BigFloat::config()->{lib}, 'Math::BigInt::BareCalc', '"try" worked');
29