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

Function can_validate_map_fields

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

Source from the content-addressed store, hash-verified

246
247#[test]
248fn can_validate_map_fields() {
249 let instance = ParentWithMapOfChildren {
250 child: [(
251 0,
252 Child {
253 value: String::new(),
254 },
255 )]
256 .iter()
257 .cloned()
258 .collect(),
259 };
260
261 let res = instance.validate();
262 assert!(res.is_err());
263 let err = res.unwrap_err();
264 let errs = err.errors();
265 assert_eq!(errs.len(), 1);
266}
267
268#[test]
269fn can_validate_option_map_fields() {

Callers

nothing calls this directly

Calls 2

collectMethod · 0.80
errorsMethod · 0.80

Tested by

no test coverage detected