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

Function can_validate_vector_fields

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

Source from the content-addressed store, hash-verified

168
169#[test]
170fn can_validate_vector_fields() {
171 let instance = ParentWithVectorOfChildren {
172 child: vec![
173 Child {
174 value: "valid".to_string(),
175 },
176 Child {
177 value: String::new(),
178 },
179 Child {
180 value: "valid".to_string(),
181 },
182 Child {
183 value: String::new(),
184 },
185 ],
186 };
187
188 let res = instance.validate();
189 assert!(res.is_err());
190 let err = res.unwrap_err();
191 let errs = err.errors();
192 assert_eq!(errs.len(), 2);
193}
194
195#[test]
196fn can_validate_array_fields() {

Callers

nothing calls this directly

Calls 1

errorsMethod · 0.80

Tested by

no test coverage detected