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

Function test_edit_hunk

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

Source from the content-addressed store, hash-verified

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