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

Function test_diff_result_statistics

atomic-core/src/diff/ops.rs:707–718  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

705
706 #[test]
707 fn test_diff_result_statistics() {
708 let mut result = DiffResult::new();
709 result.push(DiffOp::equal(0, 0, 2));
710 result.push(DiffOp::delete(2, 2, 1));
711 result.push(DiffOp::insert(3, 2, 2));
712 result.push(DiffOp::equal(3, 4, 1));
713
714 assert_eq!(result.deletions(), 1);
715 assert_eq!(result.insertions(), 2);
716 assert_eq!(result.edit_distance(), 3);
717 assert!(!result.is_unchanged());
718 }
719
720 #[test]
721 fn test_diff_result_changes() {

Callers

nothing calls this directly

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected