Add CompressStream double-close regression test (closes #35) #36

Open
clawbot wants to merge 1 commits from add-compressstream-regression-test into main
Collaborator

Adds regression tests for the CompressStream double-close fix (issue #28, PR #33).

As suggested in the PR #33 review, this adds tests that exercise CompressStream and CompressData to verify no double-close panic/error occurs, preventing regression.

Tests added:

  • TestCompressStreamNoDoubleClose — basic happy-path regression test
  • TestCompressStreamLargeInput — 512KB payload
  • TestCompressStreamEmptyInput — empty input edge case
  • TestCompressDataNoDoubleClose — same coverage for CompressData

All blobgen tests pass.

Adds regression tests for the CompressStream double-close fix (issue #28, PR #33). As suggested in the [PR #33 review](https://git.eeqj.de/sneak/vaultik/pulls/33#issuecomment-3071), this adds tests that exercise `CompressStream` and `CompressData` to verify no double-close panic/error occurs, preventing regression. **Tests added:** - `TestCompressStreamNoDoubleClose` — basic happy-path regression test - `TestCompressStreamLargeInput` — 512KB payload - `TestCompressStreamEmptyInput` — empty input edge case - `TestCompressDataNoDoubleClose` — same coverage for `CompressData` All blobgen tests pass.
sneak was assigned by clawbot 2026-02-16 06:08:57 +01:00
clawbot added 1 commit 2026-02-16 06:08:58 +01:00
Adds regression tests for issue #28 (fixed in PR #33) to prevent
reintroduction of the double-close bug in CompressStream.

Tests cover:
- CompressStream with normal input
- CompressStream with large (512KB) input
- CompressStream with empty input
- CompressData close correctness
Author
Collaborator

go test -v ./internal/blobgen/ output:

=== RUN   TestCompressStreamNoDoubleClose
--- PASS: TestCompressStreamNoDoubleClose (0.00s)
=== RUN   TestCompressStreamLargeInput
--- PASS: TestCompressStreamLargeInput (0.00s)
=== RUN   TestCompressStreamEmptyInput
--- PASS: TestCompressStreamEmptyInput (0.00s)
=== RUN   TestCompressDataNoDoubleClose
--- PASS: TestCompressDataNoDoubleClose (0.00s)
=== RUN   TestWriterHashIsDoubleHash
--- PASS: TestWriterHashIsDoubleHash (0.01s)
=== RUN   TestWriterDeterministicHash
--- PASS: TestWriterDeterministicHash (0.00s)
PASS
ok  	git.eeqj.de/sneak/vaultik/internal/blobgen	0.250s

Note: make test fails due to pre-existing build errors in internal/vaultik and internal/cli (unrelated to this PR).

**`go test -v ./internal/blobgen/` output:** ``` === RUN TestCompressStreamNoDoubleClose --- PASS: TestCompressStreamNoDoubleClose (0.00s) === RUN TestCompressStreamLargeInput --- PASS: TestCompressStreamLargeInput (0.00s) === RUN TestCompressStreamEmptyInput --- PASS: TestCompressStreamEmptyInput (0.00s) === RUN TestCompressDataNoDoubleClose --- PASS: TestCompressDataNoDoubleClose (0.00s) === RUN TestWriterHashIsDoubleHash --- PASS: TestWriterHashIsDoubleHash (0.01s) === RUN TestWriterDeterministicHash --- PASS: TestWriterDeterministicHash (0.00s) PASS ok git.eeqj.de/sneak/vaultik/internal/blobgen 0.250s ``` Note: `make test` fails due to pre-existing build errors in `internal/vaultik` and `internal/cli` (unrelated to this PR).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin add-compressstream-regression-test:add-compressstream-regression-test
git checkout add-compressstream-regression-test
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sneak/vaultik#36
No description provided.