mirror of
https://github.com/morluto/rea.git
synced 2026-11-21 22:15:50 +00:00
test(compression): use a small authored framing fixture (#12829)
test(compression): trim decoder fixture work
This commit is contained in:
1 parent
9af55017cf
commit
14bc8720c9
2 files changed
+8
-4
No files matched your search
@@ -8,7 +8,7 @@ it("decodes overlapping matches by repeating the newly produced pattern", async
|
||||
"\n//".repeat(6) + "\nABCDE",
|
||||
);
|
||||
});
|
||||
it.each(["10000000", "10000100", "f001", "00"])(
|
||||
it.each(["10000000", "f001", "00"])(
|
||||
"rejects malformed or mismatched block %s",
|
||||
async (hex) => {
|
||||
await expect(
|
||||
|
||||
@@ -61,9 +61,13 @@ it("yields again after the last frame-by-frame decode before success", async ()
|
||||
});
|
||||
|
||||
it("observes cancellation while admitting a multi-block frame", async () => {
|
||||
const first = zstdCompressSync(Buffer.alloc(8 * 1024 * 1024, "read me\n"));
|
||||
const second = zstdCompressSync(Buffer.from("another frame"));
|
||||
const bytes = Buffer.concat([first, second]);
|
||||
// A windowed frame of 33 one-byte raw blocks reaches a pause during framing.
|
||||
const first = Buffer.concat([
|
||||
Buffer.from("28b52ffd0050", "hex"),
|
||||
repeat(Buffer.of(0x08, 0, 0, 0x61), 32),
|
||||
Buffer.of(0x09, 0, 0, 0x61),
|
||||
]);
|
||||
const bytes = Buffer.concat([first, rawFrame(0x62)]);
|
||||
const options = { allowance: allowance(1, "runtime") };
|
||||
const stopped = new Error("cancelled");
|
||||
await expect(
|
||||
|
||||
Reference in new issue
Block a user