Change 14923 by jhi@alpha on 2002/03/01 14:17:54
Lost in the shuffle.
Affected files ...
.... //depot/perl/MANIFEST#747 edit
.... //depot/perl/lib/Math/BigInt/t/downgrade.t#1 add
Differences ...
==== //depot/perl/MANIFEST#747 (text) ====
Index: perl/MANIFEST
--- perl/MANIFEST.~1~ Fri Mar 1 07:30:05 2002
+++ perl/MANIFEST Fri Mar 1 07:30:05 2002
@@ -1144,6 +1144,7 @@
lib/Math/BigInt/t/calling.t Test calling conventions
lib/Math/BigInt/t/config.t Test Math::BigInt->config()
lib/Math/BigInt/t/constant.t Test Math::BigInt/BigFloat under :constant
+lib/Math/BigInt/t/downgrade.t Test if use Math::BigInt(); under downgrade works
lib/Math/BigInt/t/inf_nan.t Special tests for inf and NaN handling
lib/Math/BigInt/t/mbimbf.inc Actual BigInt/BigFloat accuracy, precicion and
fallback, round_mode tests
lib/Math/BigInt/t/mbimbf.t BigInt/BigFloat accuracy, precicion and fallback,
round_mode
==== //depot/perl/lib/Math/BigInt/t/downgrade.t#1 (text) ====
Index: perl/lib/Math/BigInt/t/downgrade.t
--- perl/lib/Math/BigInt/t/downgrade.t.~1~ Fri Mar 1 07:30:05 2002
+++ perl/lib/Math/BigInt/t/downgrade.t Fri Mar 1 07:30:05 2002
@@ -0,0 +1,39 @@
+#!/usr/bin/perl -w
+
+use Test;
+use strict;
+
+BEGIN
+ {
+ $| = 1;
+ unshift @INC, '../lib'; # for running manually
+ my $location = $0; $location =~ s/bigintpm.t//;
+ unshift @INC, $location; # to locate the testing files
+ chdir 't' if -d 't';
+ plan tests => 10;
+ }
+
+use Math::BigInt;
+use Math::BigFloat downgrade => 'Math::BigInt', upgrade => 'Math::BigInt';
+
+use vars qw ($scale $class $try $x $y $f @args $ans $ans1 $ans1_str $setup
+ $ECL $CL);
+$class = "Math::BigInt";
+$CL = "Math::BigInt::Calc";
+$ECL = "Math::BigFloat";
+
+# simplistic test for now
+ok (Math::BigFloat->downgrade(),'Math::BigInt');
+ok (Math::BigFloat->upgrade(),'Math::BigInt');
+
+# these downgrade
+ok (ref(Math::BigFloat->new('inf')),'Math::BigInt');
+ok (ref(Math::BigFloat->new('-inf')),'Math::BigInt');
+ok (ref(Math::BigFloat->new('NaN')),'Math::BigInt');
+ok (ref(Math::BigFloat->new('0')),'Math::BigInt');
+ok (ref(Math::BigFloat->new('1')),'Math::BigInt');
+ok (ref(Math::BigFloat->new('10')),'Math::BigInt');
+ok (ref(Math::BigFloat->new('-10')),'Math::BigInt');
+ok (ref(Math::BigFloat->new('-10.0E1')),'Math::BigInt');
+
+#require 'upgrade.inc'; # all tests here for sharing
End of Patch.