Skip to content

Commit 22cd22a

Browse files
committed
test(snapshot): cover exact privileged capture limit
1 parent c4756fc commit 22cd22a

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/lib/actions/sandbox/snapshot/backup-authority-script.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,19 @@ describe("OpenClaw privileged config capture script", () => {
7878
expect(result).toEqual({ status: 0, stdout: expected, stderr: "" });
7979
});
8080

81+
it("returns all bytes for a stable file at the 16 MiB limit", () => {
82+
const directory = fixtureDirectory();
83+
const expected = Buffer.alloc(MAX_CONFIG_BYTES, 0xa5);
84+
fs.writeFileSync(path.join(directory, CONFIG_NAME), expected);
85+
86+
const result = runCapture(directory);
87+
88+
expect(result.status).toBe(0);
89+
expect(result.stderr).toBe("");
90+
expect(result.stdout).toHaveLength(expected.length);
91+
expect(result.stdout.equals(expected)).toBe(true);
92+
});
93+
8194
it.each([
8295
{
8396
kind: "symbolic link",

0 commit comments

Comments
 (0)