Reconcile all83 observed Semrush URLs and make complete CI verification independent of PyPI
Rebuild V2 candidate verification / candidate (push) Failing after 1m27s
Rebuild V2 candidate verification / candidate (push) Failing after 1m27s
This commit is contained in:
1 parent
44c5797144
commit
e8cef39175
89 files changed
+110413
-1374
No files matched your search
@@ -0,0 +1,22 @@
|
||||
/** Real positive and truncated-image failure behavior, using only temp fixtures. */
|
||||
import assert from 'node:assert/strict';
|
||||
import { mkdtemp, writeFile, rm } from 'node:fs/promises';
|
||||
import { tmpdir } from 'node:os';
|
||||
import { join } from 'node:path';
|
||||
import sharp from 'sharp';
|
||||
import { decodeBatch } from './decode-raster-sharp.mjs';
|
||||
|
||||
const root = await mkdtemp(join(tmpdir(), 'videoreg-v2-raster-fixture-'));
|
||||
try {
|
||||
const good = await sharp({ create: { width: 64, height: 32, channels: 3, background: '#17382f' } }).png().toBuffer();
|
||||
await writeFile(join(root, 'good.png'), good);
|
||||
await writeFile(join(root, 'truncated.png'), good.subarray(0, 32));
|
||||
const report = await decodeBatch({ root, files: ['good.png', 'truncated.png'] });
|
||||
assert.equal(report.results[0].valid, true, 'Valid PNG must decode all pixels');
|
||||
assert.equal(report.results[0].width, 64);
|
||||
assert.equal(report.results[0].height, 32);
|
||||
assert.equal(report.results[1].valid, false, 'Truncated PNG must fail, not be skipped or treated as metadata-only pass');
|
||||
process.stdout.write(JSON.stringify({ test: 'full-raster-decode-positive-and-corruption', status: 'passed', results: report.results }) + '\n');
|
||||
} finally {
|
||||
await rm(root, { recursive: true, force: true });
|
||||
}
|
||||
Reference in new issue
Block a user