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

Function change

atomic-core/src/change/format_v3/codecs_tests.rs:9–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7use semantic::SemanticEncoding;
8
9fn change() -> Change {
10 let mut c = super::semantic::tests::large_change();
11 c.semantic_encoding = SemanticEncoding::PredictiveV2;
12 let mut start = 0;
13 for (i, line) in c.contents.split_inclusive(|b| *b == b'\n').enumerate() {
14 let end = start + line.len();
15 c.hashed.hunks.push(GraphOp::Edit {
16 change: Atom::Insertion(Insertion {
17 predecessors: vec![Position::new(None, ChangePosition::new(start as u64))],
18 successors: vec![],
19 flag: EdgeFlags::BLOCK,
20 start: ChangePosition::new(start as u64),
21 end: ChangePosition::new(end as u64),
22 inode: Position::new(None, ChangePosition::new(0)),
23 }),
24 local: Local::new("generated.rs", i as u64 + 1),
25 encoding: Some(crate::change::Encoding::Utf8),
26 });
27 start = end;
28 }
29 c
30}
31#[test]
32fn signed_objects_roundtrip_all_codec_combinations() {
33 let key = [23; 32];

Calls 4

large_changeFunction · 0.85
InsertionClass · 0.85
lenMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected