MCPcopy
hub / github.com/nodeca/pica / createTest

Function createTest

test/unit/brightness.test.ts:17–40  ·  view source on GitHub ↗
(color: number)

Source from the content-addressed store, hash-verified

15 DEST_H = 108
16
17function createTest (color: number): void {
18 const srcSize = 4 * SRC_W * SRC_H,
19 resultSize = 4 * DEST_W * DEST_H,
20 hexColor = color.toString(16),
21 src = new Uint8Array(srcSize),
22 correct = new Uint8Array(resultSize)
23
24 fill(src, color)
25 fill(correct, color)
26
27 const test_name = `test ${SRC_W}x${SRC_H} -> ${DEST_W}x${DEST_H} with color #${hexColor}${hexColor}${hexColor}`
28
29 it(test_name, async () => {
30 const result = await pica.resizeBuffer({
31 src,
32 width: SRC_W,
33 height: SRC_H,
34 toWidth: DEST_W,
35 toHeight: DEST_H
36 })
37
38 assert.deepStrictEqual(result, correct)
39 })
40}
41
42describe('Brightness should not change', () => {
43 createTest(255)

Callers 1

brightness.test.tsFile · 0.85

Calls 2

resizeBufferMethod · 0.80
fillFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…