MCPcopy Create free account
hub / github.com/hashintel/hash / captured

Function captured

libs/error-stack/tests/test_backtrace.rs:17–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15
16#[test]
17fn captured() {
18 std::env::set_var("RUST_LIB_BACKTRACE", "1");
19
20 let report = create_report();
21 #[cfg(nightly)]
22 {
23 assert_eq!(report.request_ref::<Backtrace>().count(), 1);
24 let backtrace = report
25 .request_ref::<Backtrace>()
26 .next()
27 .expect("No backtrace captured");
28 assert!(!backtrace.frames().is_empty());
29 }
30 #[cfg(not(nightly))]
31 {
32 assert!(
33 report.downcast_ref::<Backtrace>().is_some(),
34 "No backtrace captured"
35 );
36 }
37}
38
39#[test]
40#[cfg(nightly)]

Callers

nothing calls this directly

Calls 3

create_reportFunction · 0.70
expectMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected