ikarus/scheme/run-tests.ss

40 lines
987 B
Scheme
Raw Normal View History

#!/usr/bin/env ikarus --r6rs-script
(import (ikarus)
(tests reader)
2007-10-10 05:28:07 -04:00
(tests lists)
2007-06-10 13:32:48 -04:00
(tests bytevectors)
(tests strings)
(tests hashtables)
2007-10-10 05:28:07 -04:00
;(tests numbers)
;(tests bignums)
(tests fxcarry)
(tests bignum-to-flonum)
(tests string-to-number))
(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" 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"))
(test-reader)
(test-bytevectors)
(test-strings)
(test-exact-integer-sqrt)
2007-06-10 13:32:48 -04:00
(test-bignum-to-flonum)
(test-string-to-number)
2007-10-10 05:28:07 -04:00
;(test-div-and-mod)
;(test-bignums)
(test-fxcarry)
2007-10-10 05:28:07 -04:00
(test-lists)
(test-hashtables)
(printf "Happy Happy Joy Joy\n")