()
| 305 | |
| 306 | #[test] |
| 307 | fn test_pattern_with_non_string_values() { |
| 308 | let test_cases = [ |
| 309 | ("number", Value::Number(123.into())), |
| 310 | ("boolean", Value::Bool(true)), |
| 311 | ("null", Value::Null), |
| 312 | ( |
| 313 | "array", |
| 314 | Value::Array(vec![Value::String("test".to_string())]), |
| 315 | ), |
| 316 | ("object", Value::Object(serde_json::Map::new())), |
| 317 | ]; |
| 318 | |
| 319 | for (name, value) in test_cases.iter() { |
| 320 | let result = validate_pattern(name, value, Some(&"^\\d+$".to_string())); |
| 321 | assert!( |
| 322 | result.is_ok(), |
| 323 | "Non-string value {} should pass pattern validation", |
| 324 | name |
| 325 | ); |
| 326 | } |
| 327 | } |
| 328 | |
| 329 | #[test] |
| 330 | fn test_pattern_validation_edge_cases() { |
nothing calls this directly
no test coverage detected