Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add tests for sizeinbase

this covers mpz_sizeinbase
  • Loading branch information...
commit e36e70b6006d96f4235eecae60bdb1c445253022 1 parent fa43cd9
@bubaflub authored
Showing with 24 additions and 0 deletions.
  1. +24 −0 t/integer/sizeinbase.t
View
24 t/integer/sizeinbase.t
@@ -0,0 +1,24 @@
+$load "rosella/test.pbc";
+$load "src/GMP/Integer.pbc";
+
+namespace GMP {
+ class Integer;
+}
+
+class Test_GMP_Sizeinbase {
+ function test_mpz_sizeinbase() {
+ var op = new GMP.Integer("3469");
+ int base = 10;
+ int i = mpz_sizeinbase(op, base);
+ self.assert.equal(i, 4);
+ op = new GMP.Integer("400");
+ base = 30;
+ i = mpz_sizeinbase(op, base);
+ self.assert.equal(i, 2);
+ }
+}
+
+function main[main]() {
+ using Rosella.Test.test;
+ test(class Test_GMP_Sizeinbase);
+}
Please sign in to comment.
Something went wrong with that request. Please try again.