mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-07 03:35:30 -05:00
remove debugging, better is_empty test
This commit is contained in:
parent
ed126fa6bb
commit
ec92dfaa94
1 changed files with 5 additions and 5 deletions
|
|
@ -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') -> \
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue