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

Function test_validate_additional_properties_false

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

Source from the content-addressed store, hash-verified

875
876#[test]
877fn test_validate_additional_properties_false() {
878 let schema = serde_json::json!({
879 "type": "object",
880 "properties": {"name": {"type": "string"}},
881 "additionalProperties": false
882 });
883 assert!(validate_against_schema(&serde_json::json!({"name": "ok"}), &schema).is_ok());
884 let errors =
885 validate_against_schema(&serde_json::json!({"name": "ok", "extra": true}), &schema)
886 .unwrap_err();
887 assert!(errors.iter().any(|e| e.contains("extra")));
888}
889
890#[test]
891fn test_validate_number_range() {

Callers

nothing calls this directly

Calls 1

validate_against_schemaFunction · 0.85

Tested by

no test coverage detected