diff --git a/collects/net/private/ip.rkt b/collects/net/private/ip.rkt index 8238a40ef3..2ed87794a2 100644 --- a/collects/net/private/ip.rkt +++ b/collects/net/private/ip.rkt @@ -329,5 +329,9 @@ (define (bytes-of-length n) (flat-named-contract `(bytes-of-length ,n) - (λ (bs) (= (bytes-length bs) n)))) + (λ (bs) (and (bytes? bs) (= (bytes-length bs) n))))) + +(module+ test + (check-true ((bytes-of-length 5) (bytes 1 2 3 4 5))) + (check-false ((bytes-of-length 5) "moogle")))