remove debugging, better is_empty test

This commit is contained in:
carm 2015-02-22 20:01:47 -05:00
parent ed126fa6bb
commit ec92dfaa94

View file

@ -447,13 +447,13 @@ struct
let is_empty b = b.start = b.stop let is_empty b = b.start = b.stop
(*$T (*$Q
let s = Bytes.of_string "hello world" in \ Q.printable_string (fun s -> \
let s_len = Bytes.length s in \ let s_len = Bytes.length s in \
let b = ByteBuffer.create s_len in \ let b = ByteBuffer.create s_len in \
ByteBuffer.blit_from b s 0 s_len; \ ByteBuffer.blit_from b s 0 s_len; \
ByteBuffer.skip b s_len; \ ByteBuffer.skip b s_len; \
ByteBuffer.is_empty b ByteBuffer.is_empty b)
*) *)
@ -528,8 +528,8 @@ struct
else else
let len_end = Array.length b.buf - b.start in let len_end = Array.length b.buf - b.start in
if len > len_end if len > len_end
then (print_endline "case B1"; b.start <- len-len_end) (* wrap to the beginning *) then b.start <- len-len_end (* wrap to the beginning *)
else (print_endline "case B2"; b.start <- b.start + len) else b.start <- b.start + len
(*$Q (*$Q
(Q.pair Q.printable_string Q.printable_string) (fun (s,s') -> \ (Q.pair Q.printable_string Q.printable_string) (fun (s,s') -> \