()
| 41 | |
| 42 | #[test] |
| 43 | fn downcast_mut_deep() { |
| 44 | let mut report = create_report() |
| 45 | .attach_opaque(AttachmentA(10)) |
| 46 | .change_context(ContextA(0)) |
| 47 | .attach_opaque(AttachmentB(0)); |
| 48 | |
| 49 | let attachment = report |
| 50 | .downcast_mut::<AttachmentA>() |
| 51 | .expect("Attachment not found"); |
| 52 | attachment.0 += 10; |
| 53 | |
| 54 | let attachment = report |
| 55 | .downcast_ref::<AttachmentA>() |
| 56 | .expect("Attachment not found"); |
| 57 | assert_eq!(attachment.0, 20); |
| 58 | } |
| 59 | |
| 60 | #[test] |
| 61 | fn downcast_mut_second_root() { |
nothing calls this directly
no test coverage detected