1mod calculator;
15mod datetime;
16mod hash;
17mod json_path;
18mod regex;
19mod uuid_tool;
20
21pub use calculator::CalculatorTool;
22pub use datetime::DateTimeTool;
23pub use hash::HashTool;
24pub use json_path::JsonPathTool;
25pub use regex::RegexTool;
26pub use uuid_tool::UuidTool;
27
28use crate::tool::ToolRegistry;
29use std::sync::Arc;
30
31pub fn builtin_registry() -> ToolRegistry {
41 let mut registry = ToolRegistry::new();
42 registry.register(Arc::new(CalculatorTool::new()));
43 registry.register(Arc::new(DateTimeTool::new()));
44 registry.register(Arc::new(UuidTool::new()));
45 registry.register(Arc::new(HashTool::new()));
46 registry.register(Arc::new(RegexTool::new()));
47 registry.register(Arc::new(JsonPathTool::new()));
48 registry
49}
50
51#[cfg(test)]
52mod tests {
53 use super::*;
54
55 #[test]
56 fn test_builtin_registry() {
57 let registry = builtin_registry();
58
59 assert!(registry.contains("calculator"));
60 assert!(registry.contains("datetime"));
61 assert!(registry.contains("uuid"));
62 assert!(registry.contains("hash"));
63 assert!(registry.contains("regex"));
64 assert!(registry.contains("json_path"));
65 assert_eq!(registry.len(), 6);
66 }
67}