(t *testing.T)
| 57 | } |
| 58 | |
| 59 | func TestReadFileSchemaShape(t *testing.T) { |
| 60 | sch := ReadFileSchema() |
| 61 | fn, ok := sch["function"].(map[string]any) |
| 62 | if !ok { |
| 63 | t.Fatal("missing function") |
| 64 | } |
| 65 | if fn["name"] != "read_file" { |
| 66 | t.Fatalf("name wrong: %v", fn["name"]) |
| 67 | } |
| 68 | params, ok := fn["parameters"].(map[string]any) |
| 69 | if !ok { |
| 70 | t.Fatal("missing parameters") |
| 71 | } |
| 72 | props, ok := params["properties"].(map[string]any) |
| 73 | if !ok { |
| 74 | t.Fatal("missing properties") |
| 75 | } |
| 76 | if _, ok := props["path"]; !ok { |
| 77 | t.Fatal("missing property \"path\"") |
| 78 | } |
| 79 | req, ok := params["required"].([]string) |
| 80 | if !ok || len(req) != 1 || req[0] != "path" { |
| 81 | t.Fatalf("required should be [\"path\"], got %v", params["required"]) |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | func TestExecuteReadFileWrapsResult(t *testing.T) { |
| 86 | dir := t.TempDir() |
nothing calls this directly
no test coverage detected