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

Function can_validate_array_fields

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

Source from the content-addressed store, hash-verified

194
195#[test]
196fn can_validate_array_fields() {
197 let instance = ParentWithArrayOfChildren {
198 child: [
199 Child {
200 value: "valid".to_string(),
201 },
202 Child {
203 value: String::new(),
204 },
205 Child {
206 value: "valid".to_string(),
207 },
208 Child {
209 value: String::new(),
210 },
211 ],
212 };
213
214 let res = instance.validate();
215 assert!(res.is_err());
216 let err = res.unwrap_err();
217 let errs = err.errors();
218 assert_eq!(errs.len(), 2);
219}
220
221#[test]
222fn can_validate_option_vector_fields() {

Callers

nothing calls this directly

Calls 1

errorsMethod · 0.80

Tested by

no test coverage detected