mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 03:05:28 -05:00
ringbuffer isempty qtest
This commit is contained in:
parent
d8c2bd9da5
commit
9e0908dc2d
1 changed files with 10 additions and 0 deletions
|
|
@ -382,6 +382,16 @@ struct
|
|||
|
||||
let is_empty b = b.start = b.stop
|
||||
|
||||
(*$T
|
||||
let s = Bytes.of_string "hello world" in \
|
||||
let s_len = Bytes.length s in \
|
||||
let b = ByteBuffer.create s_len in \
|
||||
ByteBuffer.blit_from b s 0 s_len; \
|
||||
ByteBuffer.skip b s_len; \
|
||||
ByteBuffer.is_empty b
|
||||
*)
|
||||
|
||||
|
||||
let take_front b =
|
||||
if b.start = b.stop then raise Empty;
|
||||
let c = b.buf.(b.start) in
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue