Skip to content

Several minor improvements#40

Merged
pdgendt merged 3 commits into
mainfrom
improvs
Jun 3, 2026
Merged

Several minor improvements#40
pdgendt merged 3 commits into
mainfrom
improvs

Conversation

@pdgendt

@pdgendt pdgendt commented Jun 3, 2026

Copy link
Copy Markdown
Owner

A few doc improvements, and moving the testdata handling to an internal helper.

pdgendt added 2 commits June 3, 2026 20:27
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

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.46%. Comparing base (897f2be) to head (380a921).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #40   +/-   ##
=======================================
  Coverage   97.46%   97.46%           
=======================================
  Files           2        2           
  Lines         197      197           
=======================================
  Hits          192      192           
  Misses          4        4           
  Partials        1        1           
Files with missing lines Coverage Δ
cobs.go 98.26% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.Load to load {name}_{XX}[_r].out / {name}.in fixture 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.
@pdgendt pdgendt merged commit eb60c1d into main Jun 3, 2026
10 checks passed
@pdgendt pdgendt deleted the improvs branch June 3, 2026 19:01
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.

2 participants