Repenting of misunderstanding docs
This commit is contained in:
parent
faa0632de8
commit
aadb1b60bb
|
@ -2,32 +2,10 @@
|
|||
(require xml
|
||||
tests/eli-tester)
|
||||
|
||||
(define (ppos p)
|
||||
(define-values (line col pos) (port-next-location p))
|
||||
pos)
|
||||
|
||||
; open-input-string is broken
|
||||
(define (the-test first? second?)
|
||||
(define is (open-input-string "abcdef"))
|
||||
|
||||
(test #:failure-prefix (format "~a ~a" first? second?)
|
||||
(test
|
||||
(when first? (port-count-lines! is))
|
||||
(ppos is) => 1 (read-char is)
|
||||
(ppos is) => 2 (read-char is)
|
||||
(ppos is) => 3 (read-char is)
|
||||
(when second? (port-count-lines! is))
|
||||
(ppos is) => 4 (read-char is)
|
||||
(ppos is) => 5 (read-char is)
|
||||
(ppos is) => 6 (read-char is))))
|
||||
(test (the-test #f #f)
|
||||
(the-test #t #f)
|
||||
(the-test #f #t)
|
||||
(the-test #t #t))
|
||||
|
||||
(define p (open-input-string "abcdef"))
|
||||
(port-count-lines! p)
|
||||
(for ([x (in-range 0 6)]) (read-char p))
|
||||
(define pos (ppos p))
|
||||
(define-values (line col pos) (port-next-location p))
|
||||
|
||||
(define exn
|
||||
(with-handlers ((exn:fail? values))
|
||||
|
|
Loading…
Reference in New Issue
Block a user