Add unit tests for util package helpers#2285
Open
Jtekkk wants to merge 1 commit into
Open
Conversation
The util package's generic helpers were largely untested (~5% statement coverage). This adds table-driven and round-trip tests covering: - generics.go: Contains, Keys - resource_ids.go: RemoveElement (including input-immutability) - files.go: ByteCountBinary, DeflateBuf (deflate round-trip), CopyFile, ReadFileFromTarGz, ChmodR - cryptography.go: secure RNG (Intn, Int63n, Shuffle, Float64) range, distribution and panic behavior; PreludeEncrypt/PreludeDecrypt and RC4EncryptUnsafe round-trips - leaky: LeakyBuf Get/Put pooling, overflow, and wrong-size panic Raises util coverage to ~90% and util/leaky to 100%. No production code changes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011UEBr6PgAvPt2hp6yzBXEk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The util package's generic helpers were largely untested (~5% statement coverage). This adds table-driven and round-trip tests covering:
Raises util coverage to ~90% and util/leaky to 100%. No production code changes.
Claude-Session: https://claude.ai/code/session_011UEBr6PgAvPt2hp6yzBXEk
Card
Details