2007-11-04 23:01:41 -05:00
|
|
|
#!../src/ikarus -b ikarus.boot --r6rs-script
|
2007-05-15 12:29:47 -04:00
|
|
|
|
2007-10-25 16:27:34 -04:00
|
|
|
;;; Ikarus Scheme -- A compiler for R6RS Scheme.
|
2008-01-29 00:34:34 -05:00
|
|
|
;;; Copyright (C) 2006,2007,2008 Abdulaziz Ghuloum
|
2007-10-25 16:27:34 -04:00
|
|
|
;;;
|
|
|
|
;;; This program is free software: you can redistribute it and/or modify
|
|
|
|
;;; it under the terms of the GNU General Public License version 3 as
|
|
|
|
;;; published by the Free Software Foundation.
|
|
|
|
;;;
|
|
|
|
;;; This program is distributed in the hope that it will be useful, but
|
|
|
|
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
;;; General Public License for more details.
|
|
|
|
;;;
|
|
|
|
;;; You should have received a copy of the GNU General Public License
|
|
|
|
;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
2007-05-15 12:29:47 -04:00
|
|
|
(import (ikarus)
|
2008-05-18 05:27:55 -04:00
|
|
|
(tests bitwise-op)
|
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)
|
2008-07-07 03:22:14 -04:00
|
|
|
(tests numerics)
|
2007-10-10 05:28:07 -04:00
|
|
|
;(tests numbers)
|
2007-11-04 23:01:41 -05:00
|
|
|
(tests bignums)
|
2007-11-11 20:43:59 -05:00
|
|
|
(tests fixnums)
|
2007-11-29 20:04:28 -05:00
|
|
|
(tests div-and-mod)
|
2007-09-15 03:16:55 -04:00
|
|
|
(tests fxcarry)
|
2007-06-11 20:57:35 -04:00
|
|
|
(tests bignum-to-flonum)
|
2007-11-07 11:00:39 -05:00
|
|
|
(tests string-to-number)
|
|
|
|
(tests input-ports)
|
2007-11-11 16:48:03 -05:00
|
|
|
(tests fldiv-and-mod)
|
2007-11-15 13:40:36 -05:00
|
|
|
(tests parse-flonums)
|
2007-12-10 10:42:43 -05:00
|
|
|
(tests io)
|
2007-12-14 22:12:59 -05:00
|
|
|
(tests case-folding)
|
2008-01-20 17:52:19 -05:00
|
|
|
(tests sorting)
|
2008-03-09 00:25:03 -05:00
|
|
|
(tests fasl)
|
2007-11-07 11:00:39 -05:00
|
|
|
)
|
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))))
|
2007-10-25 14:32:26 -04:00
|
|
|
(error 'exact-integer-sqrt "wrong result" i))
|
2007-05-21 23:09:45 -04:00
|
|
|
(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"))
|
|
|
|
|
2008-05-18 05:27:55 -04:00
|
|
|
(test-bitwise-op)
|
2007-12-14 22:12:59 -05:00
|
|
|
(test-parse-flonums)
|
2008-01-12 17:32:43 -05:00
|
|
|
(test-case-folding)
|
2007-05-20 13:11:33 -04:00
|
|
|
(test-reader)
|
2007-11-07 11:24:18 -05:00
|
|
|
(test-char-syntax)
|
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)
|
2008-01-12 20:52:23 -05:00
|
|
|
(test-bignum->flonum)
|
2007-06-11 20:57:35 -04:00
|
|
|
(test-string-to-number)
|
2007-11-29 20:04:28 -05:00
|
|
|
(test-div-and-mod)
|
2007-11-04 23:01:41 -05:00
|
|
|
(test-bignums)
|
2007-12-23 17:33:13 -05:00
|
|
|
(test-bignum-length)
|
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-11-07 11:00:39 -05:00
|
|
|
(test-input-ports)
|
2007-11-07 22:28:42 -05:00
|
|
|
(test-bignum-conversion)
|
2007-11-11 16:48:03 -05:00
|
|
|
(test-fldiv-and-mod)
|
2007-11-11 20:04:09 -05:00
|
|
|
(test-fldiv0-and-mod0)
|
2007-11-11 20:43:59 -05:00
|
|
|
(test-fxdiv-and-mod)
|
2007-11-11 21:52:27 -05:00
|
|
|
(test-fxdiv0-and-mod0)
|
2007-11-13 23:24:21 -05:00
|
|
|
(test-fxlength)
|
2007-11-13 22:17:02 -05:00
|
|
|
(test-bitwise-bit-count)
|
2008-01-07 19:04:46 -05:00
|
|
|
(test-io)
|
2008-01-20 17:52:19 -05:00
|
|
|
(test-sorting)
|
2008-03-09 00:25:03 -05:00
|
|
|
(test-fasl)
|
2008-07-07 03:22:14 -04:00
|
|
|
(test-numerics)
|
2007-05-15 12:29:47 -04:00
|
|
|
(printf "Happy Happy Joy Joy\n")
|