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

Function request_attachment

libs/error-stack/tests/test_provision.rs:10–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8
9#[test]
10fn request_attachment() {
11 let report = create_report();
12 assert_eq!(report.request_ref::<u32>().count(), 0);
13
14 let report = report
15 .attach_opaque(AttachmentA(10))
16 .attach_opaque(AttachmentB(20));
17
18 let request_a = report.request_ref::<AttachmentA>().collect::<Vec<_>>();
19 assert_eq!(request_a.len(), 1);
20 assert_eq!(request_a[0].0, 10);
21
22 let request_b = report.request_ref::<AttachmentB>().collect::<Vec<_>>();
23 assert_eq!(request_b.len(), 1);
24 assert_eq!(request_b[0].0, 20);
25}
26
27#[test]
28fn request_context() {

Callers

nothing calls this directly

Calls 4

AttachmentAClass · 0.85
AttachmentBClass · 0.85
create_reportFunction · 0.70
attach_opaqueMethod · 0.45

Tested by

no test coverage detected