🧪 Testing Improvement: Add tests for SearchConfig builder methods - #24
🧪 Testing Improvement: Add tests for SearchConfig builder methods#24undivisible wants to merge 2 commits into
SearchConfig builder methods#24Conversation
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Add `search_config_builder_methods_populate_fields` to `src/lib.rs` tests to ensure that `with_blocklist` correctly populates the builder configuration. Tests were also added for other missing builder methods like `with_allowlist`, `with_timeout`, and `with_cache` for completeness. Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
Cache keys are (embedded, mode, query) after the collision fix; the clear_cache unit test still inserted a bare String and failed to compile.
519add6 to
7697737
Compare
🎯 What: The testing gap addressed is the lack of unit tests for the builder methods of
SearchConfig, specificallywith_blocklist, which populates the blocklist configuration correctly when initialized with an iterator.📊 Coverage: The scenarios now tested include checking that
with_blocklistproperly adds entries to the blocklist array in the config. For completeness,with_allowlist,with_timeout, andwith_cachehave been covered as well.✨ Result: A significant improvement in test coverage for the configuration component. This ensures the builder methods function as intended.
PR created automatically by Jules for task 1728774342231610336 started by @undivisible
Note
Low Risk
No production code changes—only a new unit test in the existing test module.
Overview
Adds a unit test
search_config_builder_methods_populate_fieldsinsrc/lib.rsthat chainsSearchConfig::newwithwith_blocklist,with_allowlist,with_timeout, andwith_cache, then asserts the resulting config holds the expected blocklist, allowlist, timeout, cache capacity, and cache TTL.This is test-only coverage for the builder API; runtime search behavior is unchanged.
Reviewed by Cursor Bugbot for commit 519add6. Configure here.