reader.test 702 B

1234567891011121314151617181920212223242526
  1. ;;;; reader.test --- test the Guile parser -*- scheme -*-
  2. ;;;; Jim Blandy <jimb@red-bean.com> --- September 1999
  3. (define (try-to-read string)
  4. (pass-if (call-with-output-string (lambda (port)
  5. (display "Try to read " port)
  6. (write string port)))
  7. (not (signals-error?
  8. 'signal
  9. (call-with-input-string string
  10. (lambda (p) (read p)))))))
  11. (try-to-read "0")
  12. (try-to-read "1++i")
  13. (try-to-read "1+i+i")
  14. (try-to-read "1+e10000i")
  15. (pass-if "radix passed to number->string can't be zero"
  16. (signals-error?
  17. 'out-of-range
  18. (number->string 10 0)))
  19. (pass-if "radix passed to number->string can't be one either"
  20. (signals-error?
  21. 'out-of-range
  22. (number->string 10 1)))