()
| 6 | |
| 7 | #[test] |
| 8 | fn downcast_ref() { |
| 9 | let mut report = create_report(); |
| 10 | assert!(report.contains::<RootError>()); |
| 11 | |
| 12 | assert!(!report.contains::<AttachmentA>()); |
| 13 | report = report.attach_opaque(AttachmentA(10)); |
| 14 | assert!(report.contains::<AttachmentA>()); |
| 15 | |
| 16 | let attachment = report |
| 17 | .downcast_ref::<AttachmentA>() |
| 18 | .expect("Attachment not found"); |
| 19 | assert_eq!(attachment.0, 10); |
| 20 | } |
| 21 | |
| 22 | #[test] |
| 23 | fn downcast_mut() { |
nothing calls this directly
no test coverage detected