Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,3 @@ For automated contributors specifically:
- Integration tests stay in the crate's `tests/` directory.
- OpenHuman's `scripts/externalize-inline-tests.mjs <repo-root> --write` moves
inline test modules out mechanically; without `--write` it only reports.
- Existing `test.rs` and `<module>_test.rs` files predate this rule. Rename each
to `<module>_tests.rs` (keep its `mod` name, add the `#[path]` attribute) the
next time you touch it.
1 change: 1 addition & 0 deletions crates/tinytools-agent/src/codecall/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ mod signature;
mod types;

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;

use serde_json::{Map, Value};
Expand Down
2 changes: 1 addition & 1 deletion crates/tinytools-agent/src/dialect/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,5 @@ pub trait ToolDialect: Send + Sync {
}

#[cfg(test)]
#[path = "test.rs"]
#[path = "mod_tests.rs"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add module-level docs to the renamed test files

This rename makes dialect/mod_tests.rs a *_tests.rs file, but it still begins with a lint attribute rather than a //! description. The same omission occurs in 12 other renamed files, including pformat_tests.rs, render/results_tests.rs, several tinytools-std filesystem/network test files, and tinytools/src/rank/mod_tests.rs; add concise module-level documentation to every newly renamed test file.

AGENTS.md reference: AGENTS.md:L202-L203

Useful? React with 👍 / 👎.

mod test;
1 change: 1 addition & 0 deletions crates/tinytools-agent/src/parse/protected.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use std::ops::Range;

#[cfg(test)]
#[path = "protected/protected_tests.rs"]
mod test;

/// Info-string languages that mark a fence as a tool call rather than a code
Expand Down
2 changes: 1 addition & 1 deletion crates/tinytools-agent/src/pformat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,5 +441,5 @@ pub(crate) fn coerce_value(raw: &str, ty: PFormatParamType) -> Value {
// ──────────────────────────────────────────────────────────────────────

#[cfg(test)]
#[path = "pformat_test.rs"]
#[path = "pformat_tests.rs"]
mod tests;
2 changes: 1 addition & 1 deletion crates/tinytools-agent/src/render/results.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,5 +364,5 @@ fn unescape_attribute(value: &str) -> String {
}

#[cfg(test)]
#[path = "results_test.rs"]
#[path = "results_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinytools-agent/src/stream/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,5 @@ fn trailing_bare_angle_bracket(tail: &str) -> Option<usize> {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinytools-jev/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

mod family;
#[cfg(test)]
#[path = "lib_tests.rs"]
mod test;
mod types;
pub use types::{
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions crates/tinytools-std/src/detect_tools/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,5 @@ impl Tool for DetectToolsTool {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinytools-std/src/filesystem/apply_patch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,4 +442,5 @@ struct FileBuffer {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
2 changes: 2 additions & 0 deletions crates/tinytools-std/src/filesystem/csv_export/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,9 @@ impl CsvExportTool {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;

#[cfg(test)]
#[path = "extra_tests.rs"]
mod extra_test;
1 change: 1 addition & 0 deletions crates/tinytools-std/src/filesystem/edit_file/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,4 +238,5 @@ impl EditFileTool {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
2 changes: 2 additions & 0 deletions crates/tinytools-std/src/filesystem/file_read/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@ fn page_contents(contents: &str, path: &str, offset: usize) -> String {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;

#[cfg(test)]
#[path = "extra_tests.rs"]
mod extra_test;
1 change: 1 addition & 0 deletions crates/tinytools-std/src/filesystem/file_write/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,4 +230,5 @@ impl FileWriteTool {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
4 changes: 4 additions & 0 deletions crates/tinytools-std/src/filesystem/git_operations/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -643,10 +643,14 @@ impl GitOperationsTool {
}

#[cfg(test)]
#[path = "config_tests.rs"]
mod config_test;
#[cfg(test)]
#[path = "ops_tests.rs"]
mod ops_test;
#[cfg(test)]
#[path = "render_tests.rs"]
mod render_test;
#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
2 changes: 2 additions & 0 deletions crates/tinytools-std/src/filesystem/glob_search/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,9 @@ fn is_skipped(name: &str) -> bool {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;

#[cfg(test)]
#[path = "extra_tests.rs"]
mod extra_test;
2 changes: 2 additions & 0 deletions crates/tinytools-std/src/filesystem/grep/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@ fn is_skipped(name: &str) -> bool {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;

#[cfg(test)]
#[path = "extra_tests.rs"]
mod extra_test;
1 change: 1 addition & 0 deletions crates/tinytools-std/src/filesystem/image_info/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,5 @@ impl Tool for ImageInfoTool {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
2 changes: 2 additions & 0 deletions crates/tinytools-std/src/filesystem/list_files/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ impl ListFilesTool {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;

#[cfg(test)]
#[path = "extra_tests.rs"]
mod extra_test;
2 changes: 2 additions & 0 deletions crates/tinytools-std/src/filesystem/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ mod update_memory_md;
mod workspace_state;

#[cfg(test)]
#[path = "gate_tests.rs"]
mod gate_test;
#[cfg(test)]
mod test_support;
Expand All @@ -66,4 +67,5 @@ pub use update_memory_md::UpdateMemoryMdTool;
pub use workspace_state::WorkspaceStateTool;

#[cfg(test)]
#[path = "contract_tests.rs"]
mod contract_test;
1 change: 1 addition & 0 deletions crates/tinytools-std/src/filesystem/read_diff/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,5 @@ impl Tool for ReadDiffTool {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinytools-std/src/filesystem/run_linter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,5 @@ impl Tool for RunLinterTool {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinytools-std/src/filesystem/run_tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,5 @@ impl Tool for RunTestsTool {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
Original file line number Diff line number Diff line change
Expand Up @@ -409,4 +409,5 @@ async fn read_or_empty(path: &std::path::Path) -> anyhow::Result<String> {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinytools-std/src/filesystem/workspace_state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,5 @@ async fn run_git(dir: &std::path::Path, args: &[&str]) -> anyhow::Result<String>
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
2 changes: 1 addition & 1 deletion crates/tinytools-std/src/network/curl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,5 +397,5 @@ fn sanitize_dest_subdir(raw: &str) -> String {
}

#[cfg(test)]
#[path = "curl_test.rs"]
#[path = "curl_tests.rs"]
mod tests;
2 changes: 1 addition & 1 deletion crates/tinytools-std/src/network/http_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,5 +425,5 @@ impl Tool for HttpRequestTool {
}

#[cfg(test)]
#[path = "http_request_test.rs"]
#[path = "http_request_tests.rs"]
mod tests;
1 change: 1 addition & 0 deletions crates/tinytools-std/src/network/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ mod pushover;
mod web_fetch;

#[cfg(test)]
#[path = "contract_tests.rs"]
mod contract_test;
#[cfg(test)]
mod test_support;
Expand Down
2 changes: 1 addition & 1 deletion crates/tinytools-std/src/network/pushover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,5 +213,5 @@ impl Tool for PushoverTool {
}

#[cfg(test)]
#[path = "pushover_test.rs"]
#[path = "pushover_tests.rs"]
mod tests;
2 changes: 1 addition & 1 deletion crates/tinytools-std/src/network/web_fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,5 +333,5 @@ fn is_html(extractor: &dyn HtmlExtractor, body: &str, content_type: Option<&str>
}

#[cfg(test)]
#[path = "web_fetch_test.rs"]
#[path = "web_fetch_tests.rs"]
mod tests;
1 change: 1 addition & 0 deletions crates/tinytools-std/src/url_guard/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -479,4 +479,5 @@ pub fn is_non_global_v6(v6: std::net::Ipv6Addr) -> bool {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinytools/src/call/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ pub use injected::{
pub use types::{ToolCallOptions, ToolTimeout};

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinytools/src/classification/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ mod types;
pub use types::{ToolCategory, ToolScope};

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinytools/src/collapse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,4 +504,5 @@ pub fn args_without_action(args: &Value) -> Value {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinytools/src/command_output/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,5 @@ pub fn sandbox_exit_code(code: i32) -> Option<i32> {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinytools/src/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ mod types;
pub use types::ToolRunContext;

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinytools/src/deferral/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,5 @@ pub fn deferred_tool_names(tools: &[Box<dyn Tool>]) -> HashSet<String> {
}

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinytools/src/naming/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ pub use types::{
};

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinytools/src/permission/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ mod types;
pub use types::PermissionLevel;

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinytools/src/policy/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ pub use types::{
};

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinytools/src/rank/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

mod bm25;
#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
mod types;

Expand Down
1 change: 1 addition & 0 deletions crates/tinytools/src/result/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ mod types;
pub use types::{FileData, ImageData, ToolContent, ToolControl, ToolErrorKind, ToolResult};

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinytools/src/spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ mod types;
pub use types::ToolSpec;

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinytools/src/tool/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ mod types;
pub use types::{Tool, ToolExposure};

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
1 change: 1 addition & 0 deletions crates/tinytools/src/workspace/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ mod types;
pub use types::{SandboxMode, WorkspaceDescriptor};

#[cfg(test)]
#[path = "mod_tests.rs"]
mod test;
Loading