(reading): Test bad # error message is formattable.
authorKevin Ryde <user42@zip.com.au>
Wed, 4 Jun 2003 16:37:30 +0000 (16:37 +0000)
committerKevin Ryde <user42@zip.com.au>
Wed, 4 Jun 2003 16:37:30 +0000 (16:37 +0000)
test-suite/tests/reader.test

index ab8d49e..6108c74 100644 (file)
   (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