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

Function test_edit_hunk

atomic-cli/src/commands/change/tests.rs:366–381  ·  view source on GitHub ↗
(path: &str, start: u64, end: u64)

Source from the content-addressed store, hash-verified

364 }
365
366 fn test_edit_hunk(path: &str, start: u64, end: u64) -> GraphOp<Hash> {
367 let change = Hash::of(format!("{}:{}:{}", path, start, end).as_bytes());
368 let inode = Position::new(change, ChangePosition::new(0));
369 GraphOp::Edit {
370 change: Atom::Insertion(Insertion {
371 predecessors: Vec::new(),
372 successors: Vec::new(),
373 flag: EdgeFlags::BLOCK,
374 start: ChangePosition::new(start),
375 end: ChangePosition::new(end),
376 inode,
377 }),
378 local: Local::new(path, 1),
379 encoding: Some(Encoding::Utf8),
380 }
381 }
382
383 #[test]
384 fn test_json_change_from_change() {

Callers

nothing calls this directly

Calls 2

InsertionClass · 0.85
as_bytesMethod · 0.45

Tested by

no test coverage detected