(t *testing.T)
| 245 | } |
| 246 | |
| 247 | func TestPublicJSONManifestSchemaFile(t *testing.T) { |
| 248 | schema := loadPublicJSONSchema(t, "../docs/json-schema/v1/manifest.schema.json") |
| 249 | if schema.Schema == "" { |
| 250 | t.Fatal("manifest schema has no $schema") |
| 251 | } |
| 252 | if schema.ID == "" { |
| 253 | t.Fatal("manifest schema has no $id") |
| 254 | } |
| 255 | if schema.Type != "object" { |
| 256 | t.Fatalf("manifest schema type = %q, want object", schema.Type) |
| 257 | } |
| 258 | want := []string{ |
| 259 | "aliases", |
| 260 | "args", |
| 261 | "auth_modes", |
| 262 | "destructive_level", |
| 263 | "dropbox_scopes", |
| 264 | "examples", |
| 265 | "flags", |
| 266 | "input_schema", |
| 267 | "manifest_version", |
| 268 | "may_prompt", |
| 269 | "path", |
| 270 | "result_kinds", |
| 271 | "result_statuses", |
| 272 | "runnable", |
| 273 | "schema_refs", |
| 274 | "scope_accuracy", |
| 275 | "short", |
| 276 | "stdin_stdout", |
| 277 | "supports_structured_output", |
| 278 | "use", |
| 279 | "warning_codes", |
| 280 | } |
| 281 | assertStringSliceEqual(t, "manifest schema required", schema.Required, want) |
| 282 | assertStringSliceEqual(t, "manifest schema properties", mapKeys(schema.Properties), want) |
| 283 | for _, def := range []string{"arg", "example", "flag", "input_property", "input_schema", "schema_refs", "stdin_stdout"} { |
| 284 | if _, ok := schema.Defs[def]; !ok { |
| 285 | t.Fatalf("manifest schema missing $defs.%s", def) |
| 286 | } |
| 287 | } |
| 288 | } |
| 289 | |
| 290 | func TestPublicJSONCommandCatalogMatchesGoldenContract(t *testing.T) { |
| 291 | got := loadJSONContractFile(t, "../docs/json-schema/v1/commands.json", "public command catalog") |
nothing calls this directly
no test coverage detected