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

Function provided

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

Source from the content-addressed store, hash-verified

39#[test]
40#[cfg(nightly)]
41fn provided() {
42 let error = ErrorB::new(10);
43 let error_backtrace = error.backtrace();
44 let error_backtrace_len = error_backtrace.frames().len();
45 #[cfg(not(miri))]
46 let error_backtrace_string = error_backtrace.to_string();
47
48 let report = Report::new(error);
49 assert_eq!(report.request_ref::<Backtrace>().count(), 1);
50 let report_backtrace = report
51 .request_ref::<Backtrace>()
52 .next()
53 .expect("No backtrace captured");
54 let report_backtrace_len = report_backtrace.frames().len();
55 #[cfg(not(miri))]
56 let report_backtrace_string = report_backtrace.to_string();
57
58 assert_eq!(error_backtrace_len, report_backtrace_len);
59 #[cfg(not(miri))]
60 assert_eq!(error_backtrace_string, report_backtrace_string);
61}

Callers

nothing calls this directly

Calls 5

backtraceMethod · 0.80
framesMethod · 0.80
lenMethod · 0.45
expectMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected