()
| 802 | |
| 803 | #[tokio::test] |
| 804 | async fn test_write_file_creates_parent_dirs() { |
| 805 | let sandbox_path = with_sandbox("rw_mkdirs"); |
| 806 | |
| 807 | let executor = ToolExecutor::new(sandbox_path); |
| 808 | |
| 809 | let call = ToolCall { |
| 810 | tool: ToolName::WriteFile, |
| 811 | input: serde_json::json!({ |
| 812 | "path": "deeply/nested/dir/file.txt", |
| 813 | "content": "nested data" |
| 814 | }), |
| 815 | }; |
| 816 | let result = executor.execute(call).await; |
| 817 | assert!( |
| 818 | !result.is_error, |
| 819 | "write with nested dirs should succeed: {}", |
| 820 | result.output |
| 821 | ); |
| 822 | |
| 823 | // Verify file exists by reading it back |
| 824 | let call = ToolCall { |
| 825 | tool: ToolName::ReadFile, |
| 826 | input: serde_json::json!({ "path": "deeply/nested/dir/file.txt" }), |
| 827 | }; |
| 828 | let result = executor.execute(call).await; |
| 829 | assert_eq!(result.output, "nested data"); |
| 830 | |
| 831 | cleanup("rw_mkdirs"); |
| 832 | } |
| 833 | |
| 834 | #[tokio::test] |
| 835 | async fn test_read_missing_field() { |
nothing calls this directly
no test coverage detected