Contract was too strict

This commit is contained in:
Jay McCarthy 2010-05-24 12:56:04 -06:00
parent 40e1ba95fc
commit 758b944996
2 changed files with 11 additions and 8 deletions

View File

@ -4,12 +4,15 @@
(define name (gensym))
(define cp (make-byte-counting-port name))
(define (test-cp cp)
(for/fold ([l 0])
([i (in-range 100)])
(define n (random 25))
(test
(file-position cp) => l
(write-bytes (make-bytes n) cp))
(+ l n)))
(test
(object-name cp) => name
(for/fold ([l 0])
([i (in-range 100)])
(define n (random 25))
(test
(file-position cp) => l
(write-bytes (make-bytes n) cp))
(+ l n)))
(test-cp cp)
(test-cp (make-byte-counting-port)))

View File

@ -14,4 +14,4 @@
get-location))
(provide/contract
[make-byte-counting-port (any/c . -> . output-port?)])
[make-byte-counting-port (() (any/c) . ->* . output-port?)])