summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--otherlibs/num/test/test_nats.ml9
1 files changed, 6 insertions, 3 deletions
diff --git a/otherlibs/num/test/test_nats.ml b/otherlibs/num/test/test_nats.ml
index 0985dcec6..bfb26f102 100644
--- a/otherlibs/num/test/test_nats.ml
+++ b/otherlibs/num/test/test_nats.ml
@@ -129,11 +129,14 @@ done
testing_function "sqrt_nat";;
test 1 equal_nat (sqrt_nat (nat_of_int 1) 0 1, nat_of_int 1);;
-test 2 equal_nat (sqrt_nat (nat_of_string "8589934592") 0 2,
+test 2 equal_nat (let n = nat_of_string "8589934592" in
+ sqrt_nat n 0 (length_nat n),
nat_of_string "92681");;
-test 3 equal_nat (sqrt_nat (nat_of_string "4294967295") 0 1,
+test 3 equal_nat (let n = nat_of_string "4294967295" in
+ sqrt_nat n 0 (length_nat n),
nat_of_string "65535");;
-test 4 equal_nat (sqrt_nat (nat_of_string "18446744065119617025") 0 2,
+test 4 equal_nat (let n = nat_of_string "18446744065119617025" in
+ sqrt_nat n 0 (length_nat n),
nat_of_string "4294967295");;
test 5 equal_nat (sqrt_nat (nat_of_int 15) 0 1,
nat_of_int 3);;