mes: open-input-string: peek fix.
* module/mes/guile.mes (open-input-string): Return actual tell. * tests/guile.test ("open-input-string peek"): Test it.
This commit is contained in:
parent
28d0c259ed
commit
0e06928320
|
@ -148,7 +148,7 @@
|
||||||
(set! tell 0)
|
(set! tell 0)
|
||||||
(set! peek-char
|
(set! peek-char
|
||||||
(lambda () (if (= tell end) (integer->char -1)
|
(lambda () (if (= tell end) (integer->char -1)
|
||||||
(string-ref string (- tell 1)))))
|
(string-ref string tell))))
|
||||||
(set! read-char
|
(set! read-char
|
||||||
(lambda () (if (= tell end) (integer->char -1)
|
(lambda () (if (= tell end) (integer->char -1)
|
||||||
(begin
|
(begin
|
||||||
|
|
|
@ -117,4 +117,10 @@ exit $?
|
||||||
(with-input-from-string "X"
|
(with-input-from-string "X"
|
||||||
(lambda () (peek-char))))
|
(lambda () (peek-char))))
|
||||||
|
|
||||||
|
(pass-if-equal "open-input-string peek"
|
||||||
|
#\X
|
||||||
|
(let ((port (open-input-string "X")))
|
||||||
|
(set-current-input-port port)
|
||||||
|
(peek-char)))
|
||||||
|
|
||||||
(result 'report)
|
(result 'report)
|
||||||
|
|
Loading…
Reference in a new issue