(t *testing.T)
| 236 | } |
| 237 | |
| 238 | func TestParseReadDirInput(t *testing.T) { |
| 239 | // Test valid input |
| 240 | input := map[string]any{ |
| 241 | "path": "/tmp/test", |
| 242 | } |
| 243 | |
| 244 | params, err := parseReadDirInput(input) |
| 245 | if err != nil { |
| 246 | t.Fatalf("parseReadDirInput failed on valid input: %v", err) |
| 247 | } |
| 248 | |
| 249 | if params.Path != "/tmp/test" { |
| 250 | t.Errorf("Expected path '/tmp/test', got %q", params.Path) |
| 251 | } |
| 252 | |
| 253 | if *params.MaxEntries != ReadDirDefaultMaxEntries { |
| 254 | t.Errorf("Expected default max_entries %d, got %d", ReadDirDefaultMaxEntries, *params.MaxEntries) |
| 255 | } |
| 256 | |
| 257 | // Test missing path |
| 258 | input = map[string]any{} |
| 259 | _, err = parseReadDirInput(input) |
| 260 | if err == nil { |
| 261 | t.Error("Expected error for missing path, got nil") |
| 262 | } |
| 263 | |
| 264 | // Test invalid max_entries |
| 265 | input = map[string]any{ |
| 266 | "path": "/tmp/test", |
| 267 | "max_entries": 0, |
| 268 | } |
| 269 | _, err = parseReadDirInput(input) |
| 270 | if err == nil { |
| 271 | t.Error("Expected error for max_entries < 1, got nil") |
| 272 | } |
| 273 | } |
| 274 | |
| 275 | func TestGetReadDirToolDefinition(t *testing.T) { |
| 276 | toolDef := GetReadDirToolDefinition() |
nothing calls this directly
no test coverage detected