xref: /onnv-gate/usr/src/cmd/perl/5.8.4/distrib/lib/Math/BigInt/t/use_lib4.t (revision 0:68f95e015346)
1#!/usr/bin/perl -w
2
3# see if using Math::BigInt and Math::BigFloat works together nicely.
4# all use_lib*.t should be equivalent, except this, since the later overrides
5# the former lib statement
6
7use strict;
8use Test;
9
10BEGIN
11  {
12  $| = 1;
13  # to locate the testing files
14  my $location = $0; $location =~ s/use_lib4.t//i;
15  if ($ENV{PERL_CORE})
16    {
17    # testing with the core distribution
18    @INC = qw(../t/lib);
19    }
20  unshift @INC, qw(../lib);     # to locate the modules
21  if (-d 't')
22    {
23    chdir 't';
24    require File::Spec;
25    unshift @INC, File::Spec->catdir(File::Spec->updir, $location);
26    }
27  else
28    {
29    unshift @INC, $location;
30    }
31  print "# INC = @INC\n";
32
33  plan tests => 2;
34  }
35
36use Math::BigInt lib => 'BareCalc';
37use Math::BigFloat lib => 'Calc';
38
39ok (Math::BigInt->config()->{lib},'Math::BigInt::Calc');
40
41ok (Math::BigFloat->new(123)->badd(123),246);
42
43