summaryrefslogtreecommitdiff
path: root/test-suite/tests/reader.test
blob: 97c89c5a72cd409364726fd7c5141b5709153fe8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
;;;; reader.test --- test the Guile parser -*- scheme -*-
;;;; Jim Blandy <jimb@red-bean.com> --- September 1999

(define (try-to-read string)
  (pass-if (call-with-output-string (lambda (port)
				      (display "Try to read " port)
				      (write string port)))
	   (not (signals-error? 
		 'signal
		 (call-with-input-string string 
					 (lambda (p) (read p)))))))

(try-to-read "0")
(try-to-read "1++i")
(try-to-read "1+i+i")
(try-to-read "1+e10000i")

(pass-if "radix passed to number->string can't be zero"
	 (signals-error?
	  'out-of-range
	  (number->string 10 0)))
(pass-if "radix passed to number->string can't be one either"
	 (signals-error?
	  'out-of-range
	  (number->string 10 1)))