calling.t revision 1
1N/A# test calling conventions, and :constant overloading 1N/A # to locate the testing files 1N/A # testing with the core distribution 1N/A print "# INC = @INC\n"; 1N/Amy $version =
'1.61';
# adjust manually to match latest release 1N/A############################################################################### 1N/A# check whether op's accept normal strings, even when inherited by subclasses 1N/A# do one positive and one negative test to avoid false positives by "accident" 1N/A next if /^#/; # skip comments 1N/A $try = '' if $args[0] eq ''; # undef, no argument 1N/A $try = "$class\->$func($try);"; 1N/A print "# Tried: '$try'\n" if !ok ($rc, $ans); 1N/A#$try = "use $class ($version.'1');"; 1N/A#ok_undef ( $x ); # should result in error! 1N/A# test whether fallback to calc works 1N/A$try .= "$class\->config()->{lib};"; 1N/Aok ( $ans, "Math::BigInt::Calc"); 1N/A# test whether constant works or not, also test for qw($version) 1N/A# bgcd() is present in subclass, too 1N/A$try .= ' $x = 2**150; bgcd($x); $x = "$x";'; 1N/Aok ( $ans, "1427247692705959881058285969449495136382746624"); 1N/A# test wether Math::BigInt::Scalar via use works (w/ dff. spellings of calc) 1N/A$try .= ' $x = 2**10; $x = "$x";'; 1N/A$ans = eval $try; ok ( $ans, "1024"); 1N/A$try .= ' $x = 2**10; $x = "$x";'; 1N/A$ans = eval $try; ok ( $ans, "1024"); 1N/A############################################################################### 1N/A# Perl 5.005 does not like ok ($x,undef) 1N/A ok (1,1) and return if !defined $x;