Skip to content

Conversation

@fank
Copy link
Member

@fank fank commented Feb 1, 2026

Summary

  • Extracts TrimQuotes, FixEscapeQuotes, and Contains utility functions to internal/util package
  • Uses modern Go patterns (strings.ReplaceAll, slices.Contains)
  • Adds comprehensive test coverage for extracted functions

Changes

  • Create internal/util/util.go with exported utility functions
  • Create internal/util/util_test.go with full test coverage
  • Update cmd/ocap_recorder/main.go to use util.* functions

Test plan

  • All existing tests pass
  • New util tests pass (go test ./internal/util/...)
  • Build succeeds (go build ./cmd/ocap_recorder/...)

fank added 3 commits February 1, 2026 01:34
Extract TrimQuotes, FixEscapeQuotes, and Contains utility functions
to internal/util package with full test coverage.
The Contains function was dead code - the original was never called,
and the wrapper just delegated to slices.Contains which is available
in the standard library since Go 1.21.
@github-actions
Copy link

github-actions bot commented Feb 1, 2026

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/OCAP2/extension/cmd/ocap_recorder 0.00% (ø)
github.com/OCAP2/extension/internal/util 100.00% (+100.00%) 🌟

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/OCAP2/extension/cmd/ocap_recorder/main.go 0.00% (ø) 0 0 0
github.com/OCAP2/extension/internal/util/util.go 100.00% (+100.00%) 2 (+2) 2 (+2) 0 🌟

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/OCAP2/extension/internal/util/util_test.go

@fank fank merged commit 42f2774 into main Feb 1, 2026
3 checks passed
@fank fank deleted the refactor/tier2-extraction branch February 1, 2026 09:48
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