mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-25 06:50:46 -08:00
16 lines
535 B
Scheme
16 lines
535 B
Scheme
;;; test-leaf.scm -- test leaf objects
|
|
;;;
|
|
;;; This test case creates many leaf objects (strings and integers).
|
|
|
|
(load "test-common.scm")
|
|
|
|
(define (triangle n) (if (eqv? n 0) 0 (+ n (triangle (- n 1)))))
|
|
(check '(triangle 10000) 50005000)
|
|
(check '(length (range 1000)) 1000)
|
|
(check '(let ((f (lambda (n) (make-string n #\x))))
|
|
(string-length (apply string-append (map f (range 100)))))
|
|
(triangle 100))
|
|
(check '(sum (map (lambda (n) (sum (range n))) (range 800))) 85653600)
|
|
|
|
(write-string "All tests pass.")
|
|
(newline)
|