MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / fixture

Function fixture

atomic-repository/tests/semantic_context_algebra.rs:46–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44}
45
46fn fixture() -> Model {
47 let mut model = Model::default();
48 for patch in ["P", "X", "Q", "Y"] {
49 model
50 .required
51 .insert(name(patch), (h("inode"), BTreeSet::from([2, 3])));
52 model
53 .provided
54 .insert(h(patch), (h("inode"), BTreeSet::from([2, 3, 4])));
55 model.attachments.insert(
56 h(patch),
57 format!("unchanged synthetic attachment for {patch}").into_bytes(),
58 );
59 }
60 model.provided.insert(
61 h("wrong-inode"),
62 (h("other inode"), BTreeSet::from([2, 3, 4])),
63 );
64 model
65 .provided
66 .insert(h("missing-item"), (h("inode"), BTreeSet::from([2])));
67 model
68}
69
70impl Model {
71 fn apply(&mut self, id: Hash, effect: Effect) -> Result<(), &'static str> {

Calls 3

nameFunction · 0.85
hFunction · 0.70
insertMethod · 0.45

Tested by

no test coverage detected