Conversation
Update ErrIncompleteFrame's doc comment, which still referred to the old ErrIncompleteData name. Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Reword the EOD comment to name the API that returns it (Decoder.WriteByte on the frame-ending sentinel) and draw the analogy to io.EOF. Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #40 +/- ##
=======================================
Coverage 97.46% 97.46%
=======================================
Files 2 2
Lines 197 197
=======================================
Hits 192 192
Misses 4 4
Partials 1 1
🚀 New features to boost your workflow:
|
Move the testdata loader into internal/testutil so both cobs_test.go and cmd/cobs/main_test.go consume the same Case struct and Load helper instead of each maintaining its own regex-driven scanner. Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
There was a problem hiding this comment.
Pull request overview
This PR refactors duplicated testdata fixture loading logic into a shared internal helper, and updates related tests and documentation to use it.
Changes:
- Introduce
internal/testutil.Loadto load{name}_{XX}[_r].out/{name}.infixture pairs as structured cases. - Update library and CLI tests to use the shared loader and simplify per-test naming.
- Make small documentation/config tweaks (error docs in
cobs.go, Codecov ignore for internal test utilities).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| internal/testutil/loader.go | Adds a shared fixture loader returning typed cases for reuse across test packages. |
| cobs.go | Updates exported error documentation for EOD and aligns frame-incomplete error comment with symbol name. |
| cobs_test.go | Switches core library tests/fuzzers to internal/testutil.Load and normalizes case display naming. |
| cmd/cobs/main_test.go | Switches CLI integration test to use shared fixture loader and reuses decoded/encoded bytes directly. |
| .codecov.yml | Excludes internal/testutil/** from Codecov reporting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+26
to
+29
| // Load reads all fixture pairs from dir. For each {name}_{XX}[_r].out file | ||
| // it pairs the encoded bytes with the matching {name}.in file. The test | ||
| // is failed if dir is unreadable, a filename is malformed, or a pair is | ||
| // incomplete. |
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.
A few doc improvements, and moving the testdata handling to an internal helper.