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

Function assertSingleChunk

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

Source from the content-addressed store, hash-verified

1026 deepStrictEqual(Arr.chunksOf(Number.NaN)([1, 2, 3]), [[1], [2], [3]])
1027
1028 const assertSingleChunk = (
1029 input: Arr.NonEmptyReadonlyArray<number>,
1030 n: number
1031 ) => {
1032 const chunks = Arr.chunksOf(n)(input)
1033 strictEqual(chunks.length, 1)
1034 deepStrictEqual(Arr.headNonEmpty(chunks), input)
1035 }
1036 // n = length
1037 assertSingleChunk(Arr.make(1, 2), 2)
1038 // 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