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 clawbot2026-02-16 06:08:57 +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
=== 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).
Code Review: CompressStream double-close regression test
Overall: Clean✅
This PR adds regression tests for issue #28 (double-close in CompressStream/CompressData). Good defensive testing.
Test Coverage
TestCompressStreamNoDoubleClose — core regression test, verifies no panic/error on the happy path.
TestCompressStreamLargeInput — 512KB random data, exercises heavier I/O paths.
TestCompressStreamEmptyInput — edge case, good.
TestCompressDataNoDoubleClose — mirrors stream test for the data variant.
Observations
Tests use a static age recipient constant — clean approach for test isolation.
Assertions check bytes written > 0, non-empty hash, and non-empty output — covers the important invariants.
Tests are in the same package (blobgen) so they can exercise internal functions directly. Fine for regression tests.
No issues found. Ready for make check verification.
## Code Review: CompressStream double-close regression test
**Overall: Clean** ✅
This PR adds regression tests for issue #28 (double-close in CompressStream/CompressData). Good defensive testing.
### Test Coverage
- `TestCompressStreamNoDoubleClose` — core regression test, verifies no panic/error on the happy path.
- `TestCompressStreamLargeInput` — 512KB random data, exercises heavier I/O paths.
- `TestCompressStreamEmptyInput` — edge case, good.
- `TestCompressDataNoDoubleClose` — mirrors stream test for the data variant.
### Observations
- Tests use a static age recipient constant — clean approach for test isolation.
- Assertions check bytes written > 0, non-empty hash, and non-empty output — covers the important invariants.
- Tests are in the same package (`blobgen`) so they can exercise internal functions directly. Fine for regression tests.
No issues found. Ready for `make check` verification.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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
CompressStreamandCompressDatato verify no double-close panic/error occurs, preventing regression.Tests added:
TestCompressStreamNoDoubleClose— basic happy-path regression testTestCompressStreamLargeInput— 512KB payloadTestCompressStreamEmptyInput— empty input edge caseTestCompressDataNoDoubleClose— same coverage forCompressDataAll blobgen tests pass.
go test -v ./internal/blobgen/output:Note:
make testfails due to pre-existing build errors ininternal/vaultikandinternal/cli(unrelated to this PR).Code Review: CompressStream double-close regression test
Overall: Clean ✅
This PR adds regression tests for issue #28 (double-close in CompressStream/CompressData). Good defensive testing.
Test Coverage
TestCompressStreamNoDoubleClose— core regression test, verifies no panic/error on the happy path.TestCompressStreamLargeInput— 512KB random data, exercises heavier I/O paths.TestCompressStreamEmptyInput— edge case, good.TestCompressDataNoDoubleClose— mirrors stream test for the data variant.Observations
blobgen) so they can exercise internal functions directly. Fine for regression tests.No issues found. Ready for
make checkverification.b13368a68ato2e7356dd85Rebased onto latest main.
make testpasses cleanly: