| 192 | |
| 193 | #[track_caller] |
| 194 | fn assert_validates_without_errors(json: serde_json::Value) { |
| 195 | let ans = validate_with_level(serde_json::from_value(json).unwrap()); |
| 196 | let ans_val = serde_json::to_value(ans).unwrap(); |
| 197 | let result: Result<ValidationAnswer, _> = serde_json::from_value(ans_val); |
| 198 | assert_matches!(result, Ok(ValidationAnswer::Success { validation_errors, validation_warnings: _, other_warnings: _ }) => { |
| 199 | assert_eq!(validation_errors.len(), 0, "Unexpected validation errors: {validation_errors:?}"); |
| 200 | }); |
| 201 | } |
| 202 | |
| 203 | #[track_caller] |
| 204 | fn assert_validates_with_errors(json: serde_json::Value) -> Vec<ValidationError> { |