MCPcopy Create free account
hub / github.com/biblius/validify / can_validate_option_set_fields

Function can_validate_option_set_fields

derive_tests/tests/nested.rs:310–327  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

308
309#[test]
310fn can_validate_option_set_fields() {
311 let instance = ParentWithOptionSetOfChildren {
312 child: Some(
313 [Child {
314 value: String::new(),
315 }]
316 .iter()
317 .cloned()
318 .collect(),
319 ),
320 };
321
322 let res = instance.validate();
323 assert!(res.is_err());
324 let err = res.unwrap_err();
325 let errs = err.errors();
326 assert_eq!(errs.len(), 1);
327}
328
329#[test]
330fn field_validations_take_priority_over_nested_validations() {

Callers

nothing calls this directly

Calls 2

collectMethod · 0.80
errorsMethod · 0.80

Tested by

no test coverage detected