MCPcopy Create free account
hub / github.com/Effect-TS/effect / assertSingleChunk

Function assertSingleChunk

packages/effect/test/Iterable.test.ts:381–388  ·  view source on GitHub ↗
(
      input: Iterable<number>,
      n: number
    )

Source from the content-addressed store, hash-verified

379 deepStrictEqual(toArray(Iter.chunksOf(-1)([1, 2, 3, 4, 5])), [[1], [2], [3], [4], [5]])
380
381 const assertSingleChunk = (
382 input: Iterable<number>,
383 n: number
384 ) => {
385 const chunks = toArray(Iter.chunksOf(n)(input))
386 strictEqual(chunks.length, 1)
387 deepStrictEqual(chunks[0], input)
388 }
389 // n = length
390 assertSingleChunk([1, 2], 2)
391 // n out of bounds

Callers 1

Iterable.test.tsFile · 0.70

Calls 3

strictEqualFunction · 0.90
deepStrictEqualFunction · 0.90
toArrayFunction · 0.70

Tested by

no test coverage detected