Skip to content

refactor(test): extract shared ZstdTestSupport, dedup helpers#40

Merged
dfa1 merged 1 commit into
mainfrom
refactor/dedup-test-helpers
Jun 27, 2026
Merged

refactor(test): extract shared ZstdTestSupport, dedup helpers#40
dfa1 merged 1 commit into
mainfrom
refactor/dedup-test-helpers

Conversation

@dfa1

@dfa1 dfa1 commented Jun 27, 2026

Copy link
Copy Markdown
Owner

Pure test-helper deduplication — no production code, no assertion changes.

What

  • New package-private ZstdTestSupport: segmentOf(Arena, byte[]), bytesOf(MemorySegment, long) + int overload, trainDictionary(int sampleCount)
  • Hoisted the byte-for-byte nativeDict(...) duplicate in ZstdDictionaryTest (two nested classes) up to the outer class
  • Updated ZstdSegmentTest, ZstdSegmentStreamTest, RefPrefixTest, ZstdStreamTest, ZstdFrameTest, ZstdMemoryTest to use it

Safety

  • Sample counts preserved exactly (3000 / 2000)
  • ZstdDictionaryTest's richer record() schema left local (a test depends on it)
  • 261 tests pass, checkstyle clean, ~67 lines removed
  • Reviewed by the project review agent: APPROVE

🤖 Generated with Claude Code

Pull duplicated unit-test helpers into a package-private ZstdTestSupport:
segmentOf(Arena,byte[]), bytesOf(MemorySegment,long/int), and
trainDictionary(int) (one sample schema, caller-chosen count). Hoist the
byte-for-byte nativeDict(...) duplicate in ZstdDictionaryTest up to the
outer class. Update ZstdSegment/SegmentStream/RefPrefix/Stream/Frame/Memory
tests to use it.

Test-only: no production change, no assertions changed, counts preserved
(3000/2000). 261 tests pass, checkstyle clean. ~67 lines removed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dfa1 dfa1 merged commit 9358d18 into main Jun 27, 2026
1 check passed
@dfa1 dfa1 deleted the refactor/dedup-test-helpers branch June 27, 2026 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant