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

Function test_merge_equal_ops

atomic-core/src/diff/patience.rs:656–670  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

654
655 #[test]
656 fn test_merge_equal_ops() {
657 let mut result = DiffResult::new();
658 result.push(DiffOp::equal(0, 0, 1));
659 result.push(DiffOp::equal(1, 1, 1));
660 result.push(DiffOp::equal(2, 2, 1));
661
662 merge_equal_ops(&mut result);
663
664 assert_eq!(result.len(), 1);
665 if let DiffOp::Equal { len, .. } = result[0] {
666 assert_eq!(len, 3);
667 } else {
668 panic!("Expected Equal operation");
669 }
670 }
671
672 #[test]
673 fn test_edit_distance() {

Callers

nothing calls this directly

Calls 2

merge_equal_opsFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected