()
| 91 | |
| 92 | #[test] |
| 93 | fn iter_mut() { |
| 94 | let mut report = build(); |
| 95 | |
| 96 | let mut chars = Vec::new(); |
| 97 | let flow = report.frames_mut(|frame| { |
| 98 | if let Some(ch) = frame.downcast_mut::<Char>() { |
| 99 | chars.push(ch.0); |
| 100 | ch.0 = ch.0.to_ascii_lowercase(); |
| 101 | } |
| 102 | ControlFlow::Continue(()) |
| 103 | }); |
| 104 | assert!(flow.is_continue()); |
| 105 | assert_eq!(chars, ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H']); |
| 106 | |
| 107 | assert_eq!( |
| 108 | report |
| 109 | .frames() |
| 110 | .filter_map(|frame| frame.downcast_ref::<Char>().map(|ch| ch.0)) |
| 111 | .collect::<Vec<_>>(), |
| 112 | ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'] |
| 113 | ); |
| 114 | } |
| 115 | |
| 116 | #[test] |
| 117 | fn iter_mut_break() { |
nothing calls this directly
no test coverage detected