* tests/reader.test: New test file.
[bpt/guile.git] / test-suite / tests / reader.test
1 ;;;; reader.test --- test the Guile parser -*- scheme -*-
2 ;;;; Jim Blandy <jimb@red-bean.com> --- September 1999
3
4 (define (try-to-read string)
5 (pass-if (call-with-output-string (lambda (port)
6 (display "Try to read " port)
7 (write string port)))
8 (catch 'signal
9 (lambda ()
10 (call-with-input-string string
11 (lambda (p) (read p)))
12 #t)
13 (lambda args #f))))
14
15 (try-to-read "0")
16 (try-to-read "1++i")
17 (try-to-read "1+i+i")
18 (try-to-read "1+e10000i")