| 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() { |