MCPcopy Create free account
hub / github.com/AI45Lab/Code / test_validate_missing_required

Function test_validate_missing_required

core/src/llm/structured_tests.rs:310–322  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

308
309#[test]
310fn test_validate_missing_required() {
311 let schema = serde_json::json!({
312 "type": "object",
313 "required": ["name", "age"],
314 "properties": {
315 "name": {"type": "string"},
316 "age": {"type": "integer"}
317 }
318 });
319 let value = serde_json::json!({"name": "Alice"});
320 let errors = validate_against_schema(&value, &schema).unwrap_err();
321 assert!(errors.iter().any(|e| e.contains("age")));
322}
323
324#[test]
325fn test_validate_wrong_type() {

Callers

nothing calls this directly

Calls 1

validate_against_schemaFunction · 0.85

Tested by

no test coverage detected