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

Function single_and_expanded_mixed

libs/error-stack/src/ext/tuple.rs:188–201  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

186
187 #[test]
188 fn single_and_expanded_mixed() {
189 let result1: Result<i32, Report<[TestError]>> = Ok(1);
190 let result2: Result<String, Report<TestError>> = Err(Report::new(TestError(0)));
191 let result3: Result<bool, Report<[TestError]>> = Err(Report::new(TestError(1)).expand());
192
193 let combined = (result1, result2, result3).try_collect();
194 let report = combined.expect_err("should have error");
195
196 // order of contexts is not guaranteed
197 let contexts: BTreeSet<_> = report.current_contexts().collect();
198 assert_eq!(contexts.len(), 2);
199 assert!(contexts.contains(&TestError(0)));
200 assert!(contexts.contains(&TestError(1)));
201 }
202
203 #[test]
204 fn multiple_errors() {

Callers

nothing calls this directly

Calls 7

OkInterface · 0.85
ErrInterface · 0.85
expandMethod · 0.80
try_collectMethod · 0.80
collectMethod · 0.80
current_contextsMethod · 0.80
TestErrorClass · 0.70

Tested by

no test coverage detected