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

Function try_multiple

libs/error-stack/src/sink.rs:511–528  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

509 #[cfg(nightly)]
510 #[test]
511 fn try_multiple() {
512 fn sink() -> Result<(), Report<[TestError]>> {
513 let mut sink = ReportSink::new();
514
515 sink.append(Report::new(TestError(0)));
516 sink.append(Report::new(TestError(1)));
517
518 sink?;
519 Ok(())
520 }
521
522 let report = sink().expect_err("should have failed");
523
524 let contexts: BTreeSet<_> = report.current_contexts().collect();
525 assert_eq!(contexts.len(), 2);
526 assert!(contexts.contains(&TestError(0)));
527 assert!(contexts.contains(&TestError(1)));
528 }
529
530 #[cfg(nightly)]
531 #[test]

Callers

nothing calls this directly

Calls 3

sinkFunction · 0.85
collectMethod · 0.80
current_contextsMethod · 0.80

Tested by

no test coverage detected