From e7e7db225c594253c1733097bc15c40d84721bfb Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Thu, 1 Oct 2026 22:14:33 +0300 Subject: [PATCH] test: rename legacy test.rs and *_test.rs files to *_tests.rs Each module keeps its name; its declaration gains a #[path] to the renamed file. Only names change, no test code does. Drops the legacy-files note from the guidance. Co-authored-by: Medulla --- AGENTS.md | 3 --- crates/tinychannels-bus/src/adapters/mod.rs | 1 + crates/tinychannels-bus/src/adapters/{test.rs => mod_tests.rs} | 0 crates/tinychannels-bus/src/channel/mod.rs | 1 + crates/tinychannels-bus/src/channel/{test.rs => mod_tests.rs} | 0 crates/tinychannels-bus/src/delivery/segment.rs | 2 +- .../src/delivery/{segment_test.rs => segment_tests.rs} | 0 crates/tinychannels-bus/src/security/mod.rs | 1 + crates/tinychannels-bus/src/security/{test.rs => mod_tests.rs} | 0 crates/tinychannels-bus/src/text/mod.rs | 2 +- crates/tinychannels-bus/src/text/{test.rs => mod_tests.rs} | 0 src/approvals/mod.rs | 1 + src/approvals/{test.rs => mod_tests.rs} | 0 src/delivery/mod.rs | 1 + src/delivery/{test.rs => mod_tests.rs} | 0 src/delivery/progressive/mod.rs | 1 + src/delivery/progressive/{test.rs => mod_tests.rs} | 0 src/harness/mod.rs | 1 + src/harness/{test.rs => mod_tests.rs} | 0 src/relay/mod.rs | 1 + src/relay/{test.rs => mod_tests.rs} | 0 src/remote/mod.rs | 1 + src/remote/{test.rs => mod_tests.rs} | 0 23 files changed, 11 insertions(+), 5 deletions(-) rename crates/tinychannels-bus/src/adapters/{test.rs => mod_tests.rs} (100%) rename crates/tinychannels-bus/src/channel/{test.rs => mod_tests.rs} (100%) rename crates/tinychannels-bus/src/delivery/{segment_test.rs => segment_tests.rs} (100%) rename crates/tinychannels-bus/src/security/{test.rs => mod_tests.rs} (100%) rename crates/tinychannels-bus/src/text/{test.rs => mod_tests.rs} (100%) rename src/approvals/{test.rs => mod_tests.rs} (100%) rename src/delivery/{test.rs => mod_tests.rs} (100%) rename src/delivery/progressive/{test.rs => mod_tests.rs} (100%) rename src/harness/{test.rs => mod_tests.rs} (100%) rename src/relay/{test.rs => mod_tests.rs} (100%) rename src/remote/{test.rs => mod_tests.rs} (100%) diff --git a/AGENTS.md b/AGENTS.md index f802268ca..34b794d44 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -145,6 +145,3 @@ changes unless they are inseparable. - 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/tinychannels-bus/src/adapters/mod.rs b/crates/tinychannels-bus/src/adapters/mod.rs index f4a01a511..d6b728cda 100644 --- a/crates/tinychannels-bus/src/adapters/mod.rs +++ b/crates/tinychannels-bus/src/adapters/mod.rs @@ -5,4 +5,5 @@ pub mod local; pub use local::{LocalChannelAdapter, LocalOutboundSink}; #[cfg(test)] +#[path = "mod_tests.rs"] mod test; diff --git a/crates/tinychannels-bus/src/adapters/test.rs b/crates/tinychannels-bus/src/adapters/mod_tests.rs similarity index 100% rename from crates/tinychannels-bus/src/adapters/test.rs rename to crates/tinychannels-bus/src/adapters/mod_tests.rs diff --git a/crates/tinychannels-bus/src/channel/mod.rs b/crates/tinychannels-bus/src/channel/mod.rs index d58fcfc63..daac5fab9 100644 --- a/crates/tinychannels-bus/src/channel/mod.rs +++ b/crates/tinychannels-bus/src/channel/mod.rs @@ -45,4 +45,5 @@ pub use types::{ }; #[cfg(test)] +#[path = "mod_tests.rs"] mod test; diff --git a/crates/tinychannels-bus/src/channel/test.rs b/crates/tinychannels-bus/src/channel/mod_tests.rs similarity index 100% rename from crates/tinychannels-bus/src/channel/test.rs rename to crates/tinychannels-bus/src/channel/mod_tests.rs diff --git a/crates/tinychannels-bus/src/delivery/segment.rs b/crates/tinychannels-bus/src/delivery/segment.rs index c23f2cad5..ac4bcc56c 100644 --- a/crates/tinychannels-bus/src/delivery/segment.rs +++ b/crates/tinychannels-bus/src/delivery/segment.rs @@ -240,5 +240,5 @@ pub fn segment_delay(segment: &str) -> u64 { } #[cfg(test)] -#[path = "segment_test.rs"] +#[path = "segment_tests.rs"] mod tests; diff --git a/crates/tinychannels-bus/src/delivery/segment_test.rs b/crates/tinychannels-bus/src/delivery/segment_tests.rs similarity index 100% rename from crates/tinychannels-bus/src/delivery/segment_test.rs rename to crates/tinychannels-bus/src/delivery/segment_tests.rs diff --git a/crates/tinychannels-bus/src/security/mod.rs b/crates/tinychannels-bus/src/security/mod.rs index 87cb9b96b..a63aefec2 100644 --- a/crates/tinychannels-bus/src/security/mod.rs +++ b/crates/tinychannels-bus/src/security/mod.rs @@ -288,4 +288,5 @@ pub fn constant_time_eq(a: &str, b: &str) -> bool { } #[cfg(test)] +#[path = "mod_tests.rs"] mod test; diff --git a/crates/tinychannels-bus/src/security/test.rs b/crates/tinychannels-bus/src/security/mod_tests.rs similarity index 100% rename from crates/tinychannels-bus/src/security/test.rs rename to crates/tinychannels-bus/src/security/mod_tests.rs diff --git a/crates/tinychannels-bus/src/text/mod.rs b/crates/tinychannels-bus/src/text/mod.rs index ab9ac2433..fc8541f70 100644 --- a/crates/tinychannels-bus/src/text/mod.rs +++ b/crates/tinychannels-bus/src/text/mod.rs @@ -399,5 +399,5 @@ fn append_indicators(chunks: Vec) -> Vec { } #[cfg(test)] -#[path = "test.rs"] +#[path = "mod_tests.rs"] mod tests; diff --git a/crates/tinychannels-bus/src/text/test.rs b/crates/tinychannels-bus/src/text/mod_tests.rs similarity index 100% rename from crates/tinychannels-bus/src/text/test.rs rename to crates/tinychannels-bus/src/text/mod_tests.rs diff --git a/src/approvals/mod.rs b/src/approvals/mod.rs index 64cee493f..b17919f8c 100644 --- a/src/approvals/mod.rs +++ b/src/approvals/mod.rs @@ -158,4 +158,5 @@ impl ApprovalSurface { } #[cfg(test)] +#[path = "mod_tests.rs"] mod test; diff --git a/src/approvals/test.rs b/src/approvals/mod_tests.rs similarity index 100% rename from src/approvals/test.rs rename to src/approvals/mod_tests.rs diff --git a/src/delivery/mod.rs b/src/delivery/mod.rs index 5aec9eb9f..b4979ea63 100644 --- a/src/delivery/mod.rs +++ b/src/delivery/mod.rs @@ -27,4 +27,5 @@ pub use types::{ }; #[cfg(test)] +#[path = "mod_tests.rs"] mod test; diff --git a/src/delivery/test.rs b/src/delivery/mod_tests.rs similarity index 100% rename from src/delivery/test.rs rename to src/delivery/mod_tests.rs diff --git a/src/delivery/progressive/mod.rs b/src/delivery/progressive/mod.rs index 11640bbd6..c3fb4281c 100644 --- a/src/delivery/progressive/mod.rs +++ b/src/delivery/progressive/mod.rs @@ -125,4 +125,5 @@ pub fn channel_supports_progressive_ui(channel: &str) -> bool { } #[cfg(test)] +#[path = "mod_tests.rs"] mod test; diff --git a/src/delivery/progressive/test.rs b/src/delivery/progressive/mod_tests.rs similarity index 100% rename from src/delivery/progressive/test.rs rename to src/delivery/progressive/mod_tests.rs diff --git a/src/harness/mod.rs b/src/harness/mod.rs index 59136bd95..8bf58f970 100644 --- a/src/harness/mod.rs +++ b/src/harness/mod.rs @@ -13,4 +13,5 @@ pub use types::{ }; #[cfg(test)] +#[path = "mod_tests.rs"] mod test; diff --git a/src/harness/test.rs b/src/harness/mod_tests.rs similarity index 100% rename from src/harness/test.rs rename to src/harness/mod_tests.rs diff --git a/src/relay/mod.rs b/src/relay/mod.rs index 8ccac42a2..7a2211903 100644 --- a/src/relay/mod.rs +++ b/src/relay/mod.rs @@ -37,4 +37,5 @@ pub use websocket::{ }; #[cfg(test)] +#[path = "mod_tests.rs"] mod test; diff --git a/src/relay/test.rs b/src/relay/mod_tests.rs similarity index 100% rename from src/relay/test.rs rename to src/relay/mod_tests.rs diff --git a/src/remote/mod.rs b/src/remote/mod.rs index 1ea4f58a7..fe2fa4536 100644 --- a/src/remote/mod.rs +++ b/src/remote/mod.rs @@ -329,4 +329,5 @@ async fn new_session( } #[cfg(test)] +#[path = "mod_tests.rs"] mod test; diff --git a/src/remote/test.rs b/src/remote/mod_tests.rs similarity index 100% rename from src/remote/test.rs rename to src/remote/mod_tests.rs