Skip to content

Commit

Permalink
Fix a typo in chunk tests. Small improvements for chunk tests
Browse files Browse the repository at this point in the history
  • Loading branch information
octet-stream committed May 19, 2023
1 parent b27151a commit 3038cd4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/util/chunk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ test("Copies the whole value if the size is less <= MAX_CHUNK_SIZE", t => {
t.is(chunks.length, 1)
})

test("Splits value if the size evenly is MAX_CHUNK_SIZE * n", t => {
const view = new Uint8Array(MAX_CHUNK_SIZE * 2)
test("Splits value evenly if the size is MAX_CHUNK_SIZE * multiplier", t => {
const multiplier = 2
const view = new Uint8Array(MAX_CHUNK_SIZE * multiplier)
const chunks = Array.from(chunk(view))

t.true(chunks.every(ch => ch.byteLength === MAX_CHUNK_SIZE))
t.is(chunks.length, 2)
t.is(chunks.length, multiplier)
})

test("The size of the last chunk can be < MAX_CHUNK_SIZE", t => {
Expand Down

0 comments on commit 3038cd4

Please sign in to comment.