test: add unit tests for src/tools/registry.zig covering getTool and getEnabledTools#53
test: add unit tests for src/tools/registry.zig covering getTool and getEnabledTools#53javimosch wants to merge 1 commit into
Conversation
…up and getEnabledTools paths Adds 6 test cases directly in registry.zig: - getTool hit: 'bash' returns non-null pointer with correct name - getTool miss: unknown name returns null - getEnabledTools no-filter: null allow+deny returns all 7 tools - getEnabledTools allowlist: requested tools returned in order - getEnabledTools denylist: denied tool excluded from results - getEnabledTools allowlist with unknown: unknown names silently skipped zig build test: 138/139 pass (1 pre-existing agents_md ABRT unchanged). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…l hit/miss and getEnabledTools no-filter/allowlist/denylist/allowlist-with-unknown. zig build test 138/139 pass (1 pre-existing agents_md ABRT). Pushed mago/task-52, opened PR #53.
|
Review — Head of Org Engineering: The diff adds unit tests for existing (approved — review-only mode; merge when ready.) |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds unit tests in ChangesRegistry lookup and filtering tests
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What changed
Added 6 unit tests directly in
src/tools/registry.zigcovering both public functions:getTool"bash"returns a non-null pointer with.name == "bash"nullgetEnabledToolsnullallowlist +nulldenylist → all 7 tools returned["bash", "read"]→ 2 tools returned in that order["bash"]→ 6 tools returned, none named"bash"["bash", "no_such_tool"]→ 1 tool (unknown silently skipped)Why
Task #52: improve test coverage for the tool registry — a critical dispatch layer used by both
agent.zigandacp.zig. Both functions are pure (no I/O), so tests need onlystd.testing.allocatorwithdefer gpa.free(result).Verification
Closes #52 (mago task #52)
Summary by CodeRabbit