()
| 7 | |
| 8 | #[test] |
| 9 | fn bail() { |
| 10 | let report = capture_error(|| bail!(RootError)).attach(PrintableA(0)); |
| 11 | assert!(report.contains::<RootError>()); |
| 12 | assert!(report.contains::<PrintableA>()); |
| 13 | assert!(!report.contains::<PrintableB>()); |
| 14 | assert_eq!(report.current_context(), &RootError); |
| 15 | assert_eq!(report.frames().count(), expect_count(2)); |
| 16 | assert_eq!( |
| 17 | remove_builtin_messages(messages(&report)), |
| 18 | remove_builtin_messages(["printable A", "root error"]) |
| 19 | ); |
| 20 | |
| 21 | let report = capture_error(|| bail!(report)).attach(PrintableB(0)); |
| 22 | assert!(report.contains::<RootError>()); |
| 23 | assert!(report.contains::<PrintableA>()); |
| 24 | assert!(report.contains::<PrintableB>()); |
| 25 | assert_eq!(report.current_context(), &RootError); |
| 26 | assert_eq!(report.frames().count(), expect_count(3)); |
| 27 | assert_eq!( |
| 28 | remove_builtin_messages(messages(&report)), |
| 29 | remove_builtin_messages(["printable B", "printable A", "root error"]) |
| 30 | ); |
| 31 | } |
| 32 | |
| 33 | #[test] |
| 34 | fn ensure() { |
nothing calls this directly
no test coverage detected