Various buglets shaken out by -Mutf8.
[p5sagit/p5-mst-13.2.git] / t / lib / bigintpm.t
index f2e9d51..6904c2d 100755 (executable)
@@ -2,14 +2,14 @@
 
 BEGIN {
     chdir 't' if -d 't';
-    unshift @INC, '../lib';
+    @INC = '../lib';
 }
 
 use Math::BigInt;
 
 $test = 0;
 $| = 1;
-print "1..276\n";
+print "1..283\n";
 while (<DATA>) {
        chop;
        if (s/^&//) {
@@ -25,6 +25,8 @@ while (<DATA>) {
                    $try .= "-\$x;";
                } elsif ($f eq "babs") {
                    $try .= "abs \$x;";
+               } elsif ($f eq "bint") {
+                   $try .= "int \$x;";
                } else {
                    $try .= "\$y = new Math::BigInt \"$args[1]\";";
                    if ($f eq "bcmp"){
@@ -64,7 +66,24 @@ while (<DATA>) {
                        print "# '$try' expected: '$ans' got: '$ans1'\n";
                }
        }
-} 
+}
+
+{
+  use Math::BigInt(0.02,':constant');
+
+  $test++;
+  print "not " 
+    unless 2**150 eq "+1427247692705959881058285969449495136382746624";
+  print "ok $test\n";
+  $test++;
+  @a = ();
+  for ($i = 1; $i < 10; $i++) {
+    push @a, $i;
+  }
+  print "not " unless "@a" eq "+1 +2 +3 +4 +5 +6 +7 +8 +9";
+  print "ok $test\n";
+}
 __END__
 &bnorm
 abc:NaN
@@ -358,3 +377,9 @@ abc:NaN
 +0:-1
 +8:-9
 +281474976710656:-281474976710657
+&bint
++0:+0
++1:+1
++11111111111111111234:+11111111111111111234
+-1:-1
+-11111111111111111234:-11111111111111111234