diff --git a/AGENTS.md b/AGENTS.md index 2efcd73..2677bad 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -46,6 +46,3 @@ PRs go to the canonical upstream repository and should be ready for review. - Integration tests stay in the crate's `tests/` directory. - OpenHuman's `scripts/externalize-inline-tests.mjs --write` moves inline test modules out mechanically; without `--write` it only reports. -- Existing `test.rs` and `_test.rs` files predate this rule. Rename each - to `_tests.rs` (keep its `mod` name, add the `#[path]` attribute) the - next time you touch it. diff --git a/crates/tinysearch-bus/src/errors/mod.rs b/crates/tinysearch-bus/src/errors/mod.rs index f817ab2..f4de152 100644 --- a/crates/tinysearch-bus/src/errors/mod.rs +++ b/crates/tinysearch-bus/src/errors/mod.rs @@ -67,4 +67,5 @@ pub fn code_of(message: &str) -> Option<&'static str> { } #[cfg(test)] +#[path = "mod_tests.rs"] mod test; diff --git a/crates/tinysearch-bus/src/errors/test.rs b/crates/tinysearch-bus/src/errors/mod_tests.rs similarity index 100% rename from crates/tinysearch-bus/src/errors/test.rs rename to crates/tinysearch-bus/src/errors/mod_tests.rs diff --git a/crates/tinysearch-bus/src/names/mod.rs b/crates/tinysearch-bus/src/names/mod.rs index 5bcdd8a..2b47cc7 100644 --- a/crates/tinysearch-bus/src/names/mod.rs +++ b/crates/tinysearch-bus/src/names/mod.rs @@ -39,4 +39,5 @@ pub fn role_for_tool(name: &str) -> Option { /// Members in interface dispatch order. pub const METHODS: &[&str] = &[methods::LIST_TOOLS, methods::EXECUTE_TOOL]; #[cfg(test)] +#[path = "mod_tests.rs"] mod test; diff --git a/crates/tinysearch-bus/src/names/test.rs b/crates/tinysearch-bus/src/names/mod_tests.rs similarity index 100% rename from crates/tinysearch-bus/src/names/test.rs rename to crates/tinysearch-bus/src/names/mod_tests.rs diff --git a/crates/tinysearch-bus/src/search/catalog/mod.rs b/crates/tinysearch-bus/src/search/catalog/mod.rs index 05ce0fc..30fe9d1 100644 --- a/crates/tinysearch-bus/src/search/catalog/mod.rs +++ b/crates/tinysearch-bus/src/search/catalog/mod.rs @@ -370,4 +370,5 @@ pub fn select_tools( } #[cfg(test)] +#[path = "mod_tests.rs"] mod test; diff --git a/crates/tinysearch-bus/src/search/catalog/test.rs b/crates/tinysearch-bus/src/search/catalog/mod_tests.rs similarity index 100% rename from crates/tinysearch-bus/src/search/catalog/test.rs rename to crates/tinysearch-bus/src/search/catalog/mod_tests.rs diff --git a/crates/tinysearch-bus/src/search/mod.rs b/crates/tinysearch-bus/src/search/mod.rs index 4488bc4..ad4c8dc 100644 --- a/crates/tinysearch-bus/src/search/mod.rs +++ b/crates/tinysearch-bus/src/search/mod.rs @@ -8,4 +8,5 @@ pub use catalog::{ }; pub use types::*; #[cfg(test)] +#[path = "mod_tests.rs"] mod test; diff --git a/crates/tinysearch-bus/src/search/test.rs b/crates/tinysearch-bus/src/search/mod_tests.rs similarity index 100% rename from crates/tinysearch-bus/src/search/test.rs rename to crates/tinysearch-bus/src/search/mod_tests.rs diff --git a/crates/tinysearch-bus/src/version/mod.rs b/crates/tinysearch-bus/src/version/mod.rs index 43208f4..3ff8c57 100644 --- a/crates/tinysearch-bus/src/version/mod.rs +++ b/crates/tinysearch-bus/src/version/mod.rs @@ -44,4 +44,5 @@ fn binds(host: (u32, u32), module: (u32, u32)) -> bool { } #[cfg(test)] +#[path = "mod_tests.rs"] mod test; diff --git a/crates/tinysearch-bus/src/version/test.rs b/crates/tinysearch-bus/src/version/mod_tests.rs similarity index 100% rename from crates/tinysearch-bus/src/version/test.rs rename to crates/tinysearch-bus/src/version/mod_tests.rs diff --git a/crates/tinysearch/src/error/mod.rs b/crates/tinysearch/src/error/mod.rs index ca764c5..37541e4 100644 --- a/crates/tinysearch/src/error/mod.rs +++ b/crates/tinysearch/src/error/mod.rs @@ -75,4 +75,5 @@ impl Error { /// Standard result type. pub type Result = std::result::Result; #[cfg(test)] +#[path = "mod_tests.rs"] mod test; diff --git a/crates/tinysearch/src/error/test.rs b/crates/tinysearch/src/error/mod_tests.rs similarity index 100% rename from crates/tinysearch/src/error/test.rs rename to crates/tinysearch/src/error/mod_tests.rs diff --git a/crates/tinysearch/src/provider/direct/parallel.rs b/crates/tinysearch/src/provider/direct/parallel.rs index 2ac5822..d43f45c 100644 --- a/crates/tinysearch/src/provider/direct/parallel.rs +++ b/crates/tinysearch/src/provider/direct/parallel.rs @@ -319,4 +319,5 @@ async fn async_response( } #[cfg(test)] +#[path = "parallel/parallel_tests.rs"] mod test; diff --git a/crates/tinysearch/src/provider/direct/parallel/test.rs b/crates/tinysearch/src/provider/direct/parallel/parallel_tests.rs similarity index 100% rename from crates/tinysearch/src/provider/direct/parallel/test.rs rename to crates/tinysearch/src/provider/direct/parallel/parallel_tests.rs diff --git a/crates/tinysearch/src/provider/direct/tavily.rs b/crates/tinysearch/src/provider/direct/tavily.rs index 608510a..eb8cd01 100644 --- a/crates/tinysearch/src/provider/direct/tavily.rs +++ b/crates/tinysearch/src/provider/direct/tavily.rs @@ -81,4 +81,5 @@ pub(super) fn unwrap(request: &ExecuteToolRequest, mut value: Value) -> Result Result