From 4f017773b9aad0d133939c473537b3170cd7bd73 Mon Sep 17 00:00:00 2001 From: 4 Bytes Robby Date: Tue, 23 Jun 2026 08:56:54 +0200 Subject: [PATCH] fix: move stride sampling test null bytes outside first/last scan windows --- test/ingest.test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/ingest.test.ts b/test/ingest.test.ts index e9b8640..734095c 100644 --- a/test/ingest.test.ts +++ b/test/ingest.test.ts @@ -836,10 +836,12 @@ describe("isBinaryContent", () => { const buf = new Uint8Array(size); buf.fill(0x20); // printable spaces // Insert null bytes at every 1024th position (stride-aligned: 1024 = 2×512) - for (let i = 1024; i < size; i += 1024) { + // Start at 8192 to place nulls outside the first 8KB thorough scan (0–8191) + // Stop before the last 8KB window to place nulls outside the final thorough scan + for (let i = 8192; i < size - 8192; i += 1024) { buf[i] = 0; } - // Stride sampling at position 1024 catches the first null byte + // Stride sampling at stride position 1024 catches the first null byte expect(isBinaryContent(buf)).toBe(true); });