;;;; reader.test --- test the Guile parser -*- scheme -*- ;;;; Jim Blandy --- September 1999 (define (try-to-read string) (pass-if (call-with-output-string (lambda (port) (display "Try to read " port) (write string port))) (not (signals-error? 'signal (call-with-input-string string (lambda (p) (read p))))))) (try-to-read "0") (try-to-read "1++i") (try-to-read "1+i+i") (try-to-read "1+e10000i") (pass-if "radix passed to number->string can't be zero" (signals-error? 'out-of-range (number->string 10 0))) (pass-if "radix passed to number->string can't be one either" (signals-error? 'out-of-range (number->string 10 1)))