MCPcopy Create free account
hub / github.com/InfinitiBit/graphbit / test_invalid_schema

Function test_invalid_schema

tests/rust_unit_tests/validation_tests.rs:293–303  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

291
292#[test]
293fn test_invalid_schema() {
294 let validator = TypeValidator::new();
295 let invalid_schema = serde_json::Value::String("not an object".to_string());
296
297 let result = validator.validate_against_schema("\"test\"", &invalid_schema);
298 assert!(!result.is_valid);
299 assert!(result
300 .errors
301 .iter()
302 .any(|e| e.error_code == "INVALID_SCHEMA"));
303}
304
305// Mock custom validator for testing
306struct MockValidator {

Callers

nothing calls this directly

Calls 2

to_stringMethod · 0.80

Tested by

no test coverage detected