add chunking tests and fix a buf with partial buffer