()
| 384 | |
| 385 | #[tokio::test] |
| 386 | async fn test_agent_simple_response() { |
| 387 | let mock_client = Arc::new(MockLlmClient::new(vec![MockLlmClient::text_response( |
| 388 | "Hello, I'm an AI assistant.", |
| 389 | )])); |
| 390 | |
| 391 | let tool_executor = Arc::new(ToolExecutor::new("/tmp".to_string())); |
| 392 | let config = AgentConfig::default(); |
| 393 | |
| 394 | let agent = AgentLoop::new( |
| 395 | mock_client.clone(), |
| 396 | tool_executor, |
| 397 | test_tool_context(), |
| 398 | config, |
| 399 | ); |
| 400 | let result = agent.execute(&[], "Hello", None).await.unwrap(); |
| 401 | |
| 402 | assert_eq!(result.text, "Hello, I'm an AI assistant."); |
| 403 | assert_eq!(result.tool_calls_count, 0); |
| 404 | assert_eq!(mock_client.call_count.load(Ordering::SeqCst), 1); |
| 405 | } |
| 406 | |
| 407 | #[tokio::test] |
| 408 | async fn test_agent_with_tool_call() { |
nothing calls this directly
no test coverage detected