Skip to content

Comments

fix: Cherry-pick string_utils improvements and add testing guidelines#865

Open
bjagg wants to merge 2 commits intoLIF-Initiative:mainfrom
bjagg:chore/cherry-pick-contractor-utils
Open

fix: Cherry-pick string_utils improvements and add testing guidelines#865
bjagg wants to merge 2 commits intoLIF-Initiative:mainfrom
bjagg:chore/cherry-pick-contractor-utils

Conversation

@bjagg
Copy link
Contributor

@bjagg bjagg commented Feb 20, 2026

Summary

  • Cherry-pick useful bits from contractor PRs 328 Add schema and dynamic_models components #813 and 328 graphql utilizing dynamic models #817 (both now closed — see docs/proposals/contractor-pr-triage.md for full assessment)
  • Fix safe_identifier() to collapse consecutive underscores (e.g. "some--thing" produces "some_thing" instead of "some__thing")
  • Replace placeholder string_utils test with 14 focused tests covering non-trivial behavior
  • Add unit testing principles to CLAUDE.md and CONTRIBUTING.md — what to test, what not to test

Testing principles added

  • Test non-trivial transformations (regex, recursion, type dispatch)
  • Test boundary conditions and edge cases
  • Include regression tests for every bug fix
  • Prefer integration-style unit tests over heavy mocking
  • Don't test trivial wrappers, framework behavior, or for coverage's sake

Test plan

  • uv run pytest test/components/lif/string_utils/ -v — 14 tests pass
  • Verify safe_identifier fix doesn't break downstream consumers

🤖 Generated with Claude Code

…ng_utils tests

Cherry-picked from contractor PRs LIF-Initiative#813/LIF-Initiative#817 (now closed):
- safe_identifier: collapse consecutive underscores produced by CamelCase
  boundary splitting combined with special characters
- Replace placeholder test with 19 real tests covering all string_utils functions

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Capture testing philosophy: test non-trivial transformations, boundary
conditions, and bug regressions. Don't test trivial wrappers, framework
behavior, or for coverage's sake. Trim 5 trivial string_utils tests
(19 -> 14) to match the stated principles.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@bjagg bjagg changed the title fix: Cherry-pick string_utils improvements from closed contractor PRs fix: Cherry-pick string_utils improvements and add testing guidelines Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant