MCPcopy Create free account
hub / github.com/baerwang/openapi-rs / test_multiple_patterns_validation

Function test_multiple_patterns_validation

src/validator/pattern_test.rs:259–281  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

257
258 #[test]
259 fn test_multiple_patterns_validation() {
260 let parameters = vec![
261 create_parameter_with_pattern("email", Some(EMAIL_PATTERN.to_string()), true),
262 create_parameter_with_pattern("phone", Some(PHONE_PATTERN.to_string()), false),
263 ];
264 let openapi = create_openapi_with_parameters(parameters);
265
266 test_query_validation(
267 &openapi,
268 &[("email", "test@example.com"), ("phone", "(555) 123-4567")],
269 true,
270 );
271
272 test_query_validation(
273 &openapi,
274 &[("email", "test@example.com"), ("phone", "invalid-phone")],
275 false,
276 );
277
278 test_query_validation(&openapi, &[("email", "test@example.com")], true);
279
280 test_query_validation(&openapi, &[("email", "invalid-email")], false);
281 }
282
283 #[test]
284 fn test_invalid_regex_pattern() {

Callers

nothing calls this directly

Calls 2

test_query_validationFunction · 0.85

Tested by

no test coverage detected