fixed bug in writing strings containing #\x85; and #\x2028;.

This commit is contained in:
Abdulaziz Ghuloum 2009-10-16 19:15:17 +03:00
parent e10ea87a31
commit 5a2de815cb
3 changed files with 14 additions and 2 deletions

View File

@ -324,7 +324,9 @@
(write-char c p)] (write-char c p)]
[(fx< b 127) [(fx< b 127)
(write-char c p)] (write-char c p)]
[(print-unicode) [(or (fx= b #x85) (fx= b #x2028))
(write-inline-hex b p)]
[(print-unicode)
(write-char c p)] (write-char c p)]
[else [else
(write-inline-hex b p)])) (write-inline-hex b p)]))

View File

@ -1 +1 @@
1860 1861

View File

@ -101,9 +101,19 @@
(define (run-tests) (define (run-tests)
(define (rw? x1)
(let ([str (let-values ([(p e) (open-string-output-port)])
(write x1 p)
(e))])
(let ([x2 (read (open-string-input-port str))])
(equal? x1 x2))))
(assert (rw? " \x85; "))
(assert (rw? " \x2028; "))
(test-char-syntax) (test-char-syntax)
(test-reader)) (test-reader))
) )