1 ;;;; reader.test --- test the Guile parser -*- scheme -*-
2 ;;;; Jim Blandy <jimb@red-bean.com> --- September 1999
4 (define (read-string s)
5 (with-input-from-string s (lambda () (read))))
7 (with-test-prefix "reading"
9 (equal? (read-string "0") 0))
11 (equal? (read-string "1++i") '1++i))
13 (equal? (read-string "1+i+i") '1+i+i))
15 (equal? (read-string "1+e10000i") '1+e10000i)))
17 (pass-if-exception "radix passed to number->string can't be zero"
18 exception:out-of-range
19 (number->string 10 0))
20 (pass-if-exception "radix passed to number->string can't be one either"
21 exception:out-of-range
22 (number->string 10 1))