(reading): Test bad # error message is formattable.

This commit is contained in:
Kevin Ryde 2003-06-04 16:37:30 +00:00
commit b7d22e033c

View file

@ -18,7 +18,20 @@
(pass-if "1+i+i"
(equal? (read-string "1+i+i") '1+i+i))
(pass-if "1+e10000i"
(equal? (read-string "1+e10000i") '1+e10000i)))
(equal? (read-string "1+e10000i") '1+e10000i))
;; At one time the arg list for "Unknown # object: ~S" didn't make it out
;; of read.c. Check that `format' can be applied to this error.
(pass-if "error message on bad #"
(catch #t
(lambda ()
(read-string "#ZZZ")
;; oops, this # is supposed to be unrecognised
#f)
(lambda (key subr message args rest)
(apply format #f message args)
;; message and args are ok
#t))))
(pass-if-exception "radix passed to number->string can't be zero"
exception:out-of-range