From 712805dcb8ec73e4d598986795a9e6b501997ae1 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 27 Aug 2026 04:16:29 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=A7=AA=20test:=20add=20missing=20test?= =?UTF-8?q?=20for=20with=5Fcache=20builder=20in=20SearchConfig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com> --- src/lib.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index c9b6ecd..7b7ebf4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1054,6 +1054,17 @@ mod tests { Ok(()) } + #[test] + fn search_config_with_cache_updates_capacity_and_ttl() { + let config = SearchConfig::new("http://localhost:8080") + .expect("valid endpoint") + .with_cache(128, Duration::from_secs(120)); + + let (capacity, ttl) = config.cache_settings(); + assert_eq!(capacity, 128); + assert_eq!(ttl, Duration::from_secs(120)); + } + #[test] fn search_config_from_url_validates_scheme_and_credentials() -> Result<(), url::ParseError> { // Valid URLs From c08f13a5fdb2f9d46491982a9d659f8ace8765b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20Carter=20=E7=A5=81=E6=98=8E=E6=80=9D?= Date: Fri, 11 Sep 2026 11:28:43 +0800 Subject: [PATCH 2/2] fix: use tuple cache key in clear_cache test Cache keys are (embedded, mode, query) after the collision fix; the clear_cache unit test still inserted a bare String and failed to compile. --- src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 7b7ebf4..76f94c6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1344,7 +1344,10 @@ mod tests { filters: SearchFilters::default(), }; - client.cache.insert("rust".to_owned(), dummy_response); + client.cache.insert( + (false, SearchMode::Balanced, "rust".to_owned()), + dummy_response, + ); assert_eq!(client.cached_entries(), 1); client.clear_cache();