2007-05-15 12:29:47 -04:00
|
|
|
#!/usr/bin/env ikarus --r6rs-script
|
|
|
|
|
|
|
|
(import (ikarus)
|
2007-05-20 13:11:33 -04:00
|
|
|
(tests reader)
|
2007-10-10 05:28:07 -04:00
|
|
|
(tests lists)
|
2007-06-10 13:32:48 -04:00
|
|
|
(tests bytevectors)
|
2007-09-03 00:17:15 -04:00
|
|
|
(tests strings)
|
2007-10-10 08:24:12 -04:00
|
|
|
(tests hashtables)
|
2007-10-10 05:28:07 -04:00
|
|
|
;(tests numbers)
|
|
|
|
;(tests bignums)
|
2007-09-15 03:16:55 -04:00
|
|
|
(tests fxcarry)
|
2007-06-11 20:57:35 -04:00
|
|
|
(tests bignum-to-flonum)
|
|
|
|
(tests string-to-number))
|
2007-05-15 12:29:47 -04:00
|
|
|
|
2007-05-21 23:09:45 -04:00
|
|
|
(define (test-exact-integer-sqrt)
|
|
|
|
(define (f i j inc)
|
|
|
|
(when (< i j)
|
|
|
|
(let-values ([(s r) (exact-integer-sqrt i)])
|
|
|
|
(unless (and (= (+ (* s s) r) i)
|
|
|
|
(< i (* (+ s 1) (+ s 1))))
|
|
|
|
(error 'exact-integer-sqrt "wrong result for ~s" i))
|
|
|
|
(f (+ i inc) j inc))))
|
|
|
|
(f 0 10000 1)
|
|
|
|
(f 0 536870911 10000)
|
|
|
|
(f 0 536870911000 536870911)
|
|
|
|
(printf "[exact-integer-sqrt] Happy Happy Joy Joy\n"))
|
|
|
|
|
2007-05-20 13:11:33 -04:00
|
|
|
(test-reader)
|
2007-05-15 12:29:47 -04:00
|
|
|
(test-bytevectors)
|
2007-09-03 00:17:15 -04:00
|
|
|
(test-strings)
|
2007-05-21 23:09:45 -04:00
|
|
|
(test-exact-integer-sqrt)
|
2007-06-10 13:32:48 -04:00
|
|
|
(test-bignum-to-flonum)
|
2007-06-11 20:57:35 -04:00
|
|
|
(test-string-to-number)
|
2007-10-10 05:28:07 -04:00
|
|
|
;(test-div-and-mod)
|
|
|
|
;(test-bignums)
|
2007-09-15 03:16:55 -04:00
|
|
|
(test-fxcarry)
|
2007-10-10 05:28:07 -04:00
|
|
|
(test-lists)
|
2007-10-10 08:24:12 -04:00
|
|
|
(test-hashtables)
|
2007-05-15 12:29:47 -04:00
|
|
|
(printf "Happy Happy Joy Joy\n")
|