Adding more test cases

This commit is contained in:
Justin Ethier 2022-06-07 21:44:17 -04:00
parent 0a366a8aca
commit 7e5c29b939

View file

@ -7,6 +7,16 @@
bignum2string(data, k, bn, obj_obj2int(radix));
")
(define-c test-larger-bn
"(void *data, int argc, closure _, object k, object fx, object fx2, object radix)"
" bignum2_type *bn = gc_alloc_bignum2(data, 2);
C_bignum_digits(bn)[0] = obj_obj2int(fx2);
C_bignum_digits(bn)[1] = obj_obj2int(fx);
bn->num_digits = 2;
bn->sign = 0;
bignum2string(data, k, bn, obj_obj2int(radix));
")
(write
(list
(test-bn -10 10)
@ -16,6 +26,9 @@
(test-bn #x0FFFffff 10)
(test-bn #x0FFFffff 16)
(test-bn #x3FFFffff 10)
(test-bn #x0FFF0001 10)
(test-larger-bn 0 #x0FFF0001 10)
(test-larger-bn #x3FFF0000 #x0FFF0001 10)
))
(newline)
;(repl)