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

Function assertSingleChunk

packages/effect/test/Array.test.ts:1009–1016  ·  view source on GitHub ↗
(
      input: Arr.NonEmptyReadonlyArray<number>,
      n: number
    )

Source from the content-addressed store, hash-verified

1007 deepStrictEqual(Arr.chunksOf(-1)([1, 2, 3, 4, 5]), [[1], [2], [3], [4], [5]])
1008
1009 const assertSingleChunk = (
1010 input: Arr.NonEmptyReadonlyArray<number>,
1011 n: number
1012 ) => {
1013 const chunks = Arr.chunksOf(n)(input)
1014 strictEqual(chunks.length, 1)
1015 deepStrictEqual(Arr.headNonEmpty(chunks), input)
1016 }
1017 // n = length
1018 assertSingleChunk(Arr.make(1, 2), 2)
1019 // n out of bounds

Callers 1

Array.test.tsFile · 0.70

Calls 2

strictEqualFunction · 0.90
deepStrictEqualFunction · 0.90

Tested by

no test coverage detected